libMesh::FE< Dim, T > Class Template Reference

Template class which generates the different FE families and orders. More...

#include <fe.h>

Inheritance diagram for libMesh::FE< Dim, T >:

Public Types

typedef FEGenericBase< typename FEOutputType< T >::type >::OutputShape OutputShape
 
typedef TensorTools::IncrementRank< OutputShape >::type OutputGradient
 
typedef TensorTools::IncrementRank< OutputGradient >::type OutputTensor
 
typedef TensorTools::DecrementRank< OutputShape >::type OutputDivergence
 
typedef TensorTools::MakeNumber< OutputShape >::type OutputNumber
 
typedef TensorTools::IncrementRank< OutputNumber >::type OutputNumberGradient
 
typedef TensorTools::IncrementRank< OutputNumberGradient >::type OutputNumberTensor
 
typedef TensorTools::DecrementRank< OutputNumber >::type OutputNumberDivergence
 

Public Member Functions

 FE (const FEType &fet)
 
virtual unsigned int n_shape_functions () const libmesh_override
 
virtual FEContinuity get_continuity () const libmesh_override
 
virtual bool is_hierarchic () const libmesh_override
 
virtual void reinit (const Elem *elem, const std::vector< Point > *const pts=libmesh_nullptr, const std::vector< Real > *const weights=libmesh_nullptr) libmesh_override
 
virtual void reinit (const Elem *elem, const unsigned int side, const Real tolerance=TOLERANCE, const std::vector< Point > *const pts=libmesh_nullptr, const std::vector< Real > *const weights=libmesh_nullptr) libmesh_override
 
virtual void edge_reinit (const Elem *elem, const unsigned int edge, const Real tolerance=TOLERANCE, const std::vector< Point > *const pts=libmesh_nullptr, const std::vector< Real > *const weights=libmesh_nullptr) libmesh_override
 
virtual void side_map (const Elem *elem, const Elem *side, const unsigned int s, const std::vector< Point > &reference_side_points, std::vector< Point > &reference_points) libmesh_override
 
virtual void attach_quadrature_rule (QBase *q) libmesh_override
 
virtual unsigned int n_quadrature_points () const libmesh_override
 
virtual bool shapes_need_reinit () const libmesh_override
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order order, const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *libmesh_dbg_var(elem), const Order, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *libmesh_dbg_var(elem), const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *libmesh_dbg_var(elem), const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int, const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int, const Point &p)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const Point &p)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
template<>
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const Point &p)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
template<>
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
template<>
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order order, const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order order, const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order order, const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order order, const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
RealGradient shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
template<>
RealGradient shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
template<>
RealGradient shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
template<>
RealGradient shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
template<>
RealGradient shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
RealGradient shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
RealGradient shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
RealGradient shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
RealGradient shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
template<>
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const Point &p)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const Point &p)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const Point &p)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
void nodal_soln (const Elem *, const Order, const std::vector< Number > &, std::vector< Number > &)
 
template<>
void nodal_soln (const Elem *, const Order, const std::vector< Number > &, std::vector< Number > &)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
unsigned int n_dofs (const ElemType, const Order)
 
template<>
unsigned int n_dofs (const ElemType, const Order)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
template<>
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
RealGradient shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
RealGradient shape (const Elem *, const Order, const unsigned int, const Point &)
 
template<>
RealGradient shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
RealGradient shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
RealGradient shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
RealGradient shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
RealGradient shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
RealGradient shape (const Elem *, const Order, const unsigned int, const Point &)
 
template<>
RealGradient shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
RealGradient shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
RealGradient shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
RealGradient shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
RealGradient shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
RealGradient shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
RealGradient shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
RealGradient shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &)
 
template<>
RealGradient shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
RealGradient shape_second_deriv (const Elem *elem, const Order order, const unsigned int libmesh_dbg_var(i), const unsigned int libmesh_dbg_var(j), const Point &)
 
template<>
RealGradient shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
RealGradient shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
RealGradient shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
RealGradient shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
RealGradient shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
RealGradient shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &libmesh_dbg_var(p))
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
unsigned int n_dofs (const ElemType, const Order o)
 
template<>
unsigned int n_dofs (const ElemType, const Order o)
 
template<>
unsigned int n_dofs (const ElemType, const Order o)
 
template<>
unsigned int n_dofs (const ElemType, const Order o)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
template<>
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *, const Order, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *, const Order, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *, const Order, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *, const Order, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType type, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType type, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
void nodal_soln (const Elem *elem, const Order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void side_map (const Elem *, const Elem *, const unsigned int, const std::vector< Point > &, std::vector< Point > &)
 
template<>
void edge_reinit (Elem const *, unsigned int, Real, const std::vector< Point > *const, const std::vector< Real > *const)
 
template<>
Point inverse_map (const Elem *, const Point &, const Real, const bool)
 
template<>
void inverse_map (const Elem *, const std::vector< Point > &, std::vector< Point > &, Real, bool)
 
template<>
unsigned int n_dofs (const ElemType, const Order)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_per_elem (const ElemType, const Order)
 
template<>
void dofs_on_side (const Elem *const, const Order, unsigned int, std::vector< unsigned int > &di)
 
template<>
void dofs_on_edge (const Elem *const, const Order, unsigned int, std::vector< unsigned int > &di)
 
template<>
FEContinuity get_continuity () const
 
template<>
bool is_hierarchic () const
 
template<>
bool shapes_need_reinit () const
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const Point &p)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &p)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *, const Order, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
void nodal_soln (const Elem *elem, const Order order, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_at_node (const ElemType, const Order, const unsigned int)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
FEContinuity get_continuity () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
bool is_hierarchic () const
 
template<>
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
template<>
void compute_constraints (DofConstraints &, DofMap &, const unsigned int, const Elem *)
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
bool shapes_need_reinit () const
 
template<>
Real shape (const ElemType, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape (const Elem *, const Order, const unsigned int libmesh_dbg_var(i), const Point &)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const Point &point_in)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &point_in)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int libmesh_dbg_var(j), const Point &point_in)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const Point &point_in)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &point_in)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &point_in)
 
template<>
Real shape (const ElemType, const Order, const unsigned int, const Point &)
 
template<>
Real shape (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const Point &point_in)
 
template<>
Real shape_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &point_in)
 
template<>
Real shape_second_deriv (const ElemType, const Order, const unsigned int, const unsigned int, const Point &)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order libmesh_dbg_var(order), const unsigned int i, const unsigned int j, const Point &point_in)
 
template<>
Real shape (const Elem *elem, const Order order, const unsigned int i, const Point &p)
 
template<>
Real shape_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
template<>
Real shape_second_deriv (const Elem *elem, const Order order, const unsigned int i, const unsigned int j, const Point &p)
 
const std::vector< std::vector< OutputShape > > & get_phi () const
 
const std::vector< std::vector< OutputGradient > > & get_dphi () const
 
const std::vector< std::vector< OutputShape > > & get_curl_phi () const
 
const std::vector< std::vector< OutputDivergence > > & get_div_phi () const
 
const std::vector< std::vector< OutputShape > > & get_dphidx () const
 
const std::vector< std::vector< OutputShape > > & get_dphidy () const
 
const std::vector< std::vector< OutputShape > > & get_dphidz () const
 
const std::vector< std::vector< OutputShape > > & get_dphidxi () const
 
const std::vector< std::vector< OutputShape > > & get_dphideta () const
 
const std::vector< std::vector< OutputShape > > & get_dphidzeta () const
 
const std::vector< std::vector< OutputTensor > > & get_d2phi () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidx2 () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidxdy () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidxdz () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidy2 () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidydz () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidz2 () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidxi2 () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidxideta () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidxidzeta () const
 
const std::vector< std::vector< OutputShape > > & get_d2phideta2 () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidetadzeta () const
 
const std::vector< std::vector< OutputShape > > & get_d2phidzeta2 () const
 
const std::vector< OutputGradient > & get_dphase () const
 
const std::vector< Real > & get_Sobolev_weight () const
 
const std::vector< RealGradient > & get_Sobolev_dweight () const
 
void print_phi (std::ostream &os) const
 
void print_dphi (std::ostream &os) const
 
void print_d2phi (std::ostream &os) const
 
const std::vector< Point > & get_xyz () const
 
const std::vector< Real > & get_JxW () const
 
const std::vector< RealGradient > & get_dxyzdxi () const
 
const std::vector< RealGradient > & get_dxyzdeta () const
 
const std::vector< RealGradient > & get_dxyzdzeta () const
 
const std::vector< RealGradient > & get_d2xyzdxi2 () const
 
const std::vector< RealGradient > & get_d2xyzdeta2 () const
 
const std::vector< RealGradient > & get_d2xyzdzeta2 () const
 
const std::vector< RealGradient > & get_d2xyzdxideta () const
 
const std::vector< RealGradient > & get_d2xyzdxidzeta () const
 
const std::vector< RealGradient > & get_d2xyzdetadzeta () const
 
const std::vector< Real > & get_dxidx () const
 
const std::vector< Real > & get_dxidy () const
 
const std::vector< Real > & get_dxidz () const
 
const std::vector< Real > & get_detadx () const
 
const std::vector< Real > & get_detady () const
 
const std::vector< Real > & get_detadz () const
 
const std::vector< Real > & get_dzetadx () const
 
const std::vector< Real > & get_dzetady () const
 
const std::vector< Real > & get_dzetadz () const
 
const std::vector< std::vector< Point > > & get_tangents () const
 
const std::vector< Point > & get_normals () const
 
const std::vector< Real > & get_curvatures () const
 
ElemType get_type () const
 
unsigned int get_p_level () const
 
FEType get_fe_type () const
 
Order get_order () const
 
void set_fe_order (int new_order)
 
FEFamily get_family () const
 
const FEMapget_fe_map () const
 
void print_JxW (std::ostream &os) const
 
void print_xyz (std::ostream &os) const
 
void print_info (std::ostream &os) const
 

Static Public Member Functions

static OutputShape shape (const ElemType t, const Order o, const unsigned int i, const Point &p)
 
static OutputShape shape (const Elem *elem, const Order o, const unsigned int i, const Point &p)
 
static OutputShape shape_deriv (const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
 
static OutputShape shape_deriv (const Elem *elem, const Order o, const unsigned int i, const unsigned int j, const Point &p)
 
static OutputShape shape_second_deriv (const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
 
static OutputShape shape_second_deriv (const Elem *elem, const Order o, const unsigned int i, const unsigned int j, const Point &p)
 
static void nodal_soln (const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
 
static unsigned int n_shape_functions (const ElemType t, const Order o)
 
static unsigned int n_dofs (const ElemType t, const Order o)
 
static unsigned int n_dofs_at_node (const ElemType t, const Order o, const unsigned int n)
 
static unsigned int n_dofs_per_elem (const ElemType t, const Order o)
 
static void dofs_on_side (const Elem *const elem, const Order o, unsigned int s, std::vector< unsigned int > &di)
 
static void dofs_on_edge (const Elem *const elem, const Order o, unsigned int e, std::vector< unsigned int > &di)
 
static Point inverse_map (const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
 
static void inverse_map (const Elem *elem, const std::vector< Point > &physical_points, std::vector< Point > &reference_points, const Real tolerance=TOLERANCE, const bool secure=true)
 
static void compute_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
static Point map (const Elem *elem, const Point &reference_point)
 
static Point map_xi (const Elem *elem, const Point &reference_point)
 
static Point map_eta (const Elem *elem, const Point &reference_point)
 
static Point map_zeta (const Elem *elem, const Point &reference_point)
 
static UniquePtr< FEGenericBasebuild (const unsigned int dim, const FEType &type)
 
static UniquePtr< FEGenericBasebuild_InfFE (const unsigned int dim, const FEType &type)
 
static void compute_proj_constraints (DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
 
static void coarsened_dof_values (const NumericVector< Number > &global_vector, const DofMap &dof_map, const Elem *coarse_elem, DenseVector< Number > &coarse_dofs, const unsigned int var, const bool use_old_dof_indices=false)
 
static void coarsened_dof_values (const NumericVector< Number > &global_vector, const DofMap &dof_map, const Elem *coarse_elem, DenseVector< Number > &coarse_dofs, const bool use_old_dof_indices=false)
 
static void compute_periodic_constraints (DofConstraints &constraints, DofMap &dof_map, const PeriodicBoundaries &boundaries, const MeshBase &mesh, const PointLocatorBase *point_locator, const unsigned int variable_number, const Elem *elem)
 
static bool on_reference_element (const Point &p, const ElemType t, const Real eps=TOLERANCE)
 
static void get_refspace_nodes (const ElemType t, std::vector< Point > &nodes)
 
static void compute_node_constraints (NodeConstraints &constraints, const Elem *elem)
 
static void compute_periodic_node_constraints (NodeConstraints &constraints, const PeriodicBoundaries &boundaries, const MeshBase &mesh, const PointLocatorBase *point_locator, const Elem *elem)
 
static void print_info (std::ostream &out=libMesh::out)
 
static std::string get_info ()
 
static unsigned int n_objects ()
 
static void enable_print_counter_info ()
 
static void disable_print_counter_info ()
 

Protected Types

typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 

Protected Member Functions

virtual void init_shape_functions (const std::vector< Point > &qp, const Elem *e)
 
virtual void init_base_shape_functions (const std::vector< Point > &qp, const Elem *e) libmesh_override
 
void determine_calculations ()
 
virtual void compute_shape_functions (const Elem *elem, const std::vector< Point > &qp)
 
void increment_constructor_count (const std::string &name)
 
void increment_destructor_count (const std::string &name)
 

Protected Attributes

std::vector< Pointcached_nodes
 
ElemType last_side
 
unsigned int last_edge
 
UniquePtr< FETransformationBase< FEOutputType< T >::type > > _fe_trans
 
std::vector< std::vector< OutputShape > > phi
 
std::vector< std::vector< OutputGradient > > dphi
 
std::vector< std::vector< OutputShape > > curl_phi
 
std::vector< std::vector< OutputDivergence > > div_phi
 
std::vector< std::vector< OutputShape > > dphidxi
 
std::vector< std::vector< OutputShape > > dphideta
 
std::vector< std::vector< OutputShape > > dphidzeta
 
std::vector< std::vector< OutputShape > > dphidx
 
std::vector< std::vector< OutputShape > > dphidy
 
std::vector< std::vector< OutputShape > > dphidz
 
std::vector< std::vector< OutputTensor > > d2phi
 
std::vector< std::vector< OutputShape > > d2phidxi2
 
std::vector< std::vector< OutputShape > > d2phidxideta
 
std::vector< std::vector< OutputShape > > d2phidxidzeta
 
std::vector< std::vector< OutputShape > > d2phideta2
 
std::vector< std::vector< OutputShape > > d2phidetadzeta
 
std::vector< std::vector< OutputShape > > d2phidzeta2
 
std::vector< std::vector< OutputShape > > d2phidx2
 
std::vector< std::vector< OutputShape > > d2phidxdy
 
std::vector< std::vector< OutputShape > > d2phidxdz
 
std::vector< std::vector< OutputShape > > d2phidy2
 
std::vector< std::vector< OutputShape > > d2phidydz
 
std::vector< std::vector< OutputShape > > d2phidz2
 
std::vector< OutputGradientdphase
 
std::vector< RealGradientdweight
 
std::vector< Realweight
 
UniquePtr< FEMap_fe_map
 
const unsigned int dim
 
bool calculations_started
 
bool calculate_phi
 
bool calculate_dphi
 
bool calculate_d2phi
 
bool calculate_curl_phi
 
bool calculate_div_phi
 
bool calculate_dphiref
 
FEType fe_type
 
ElemType elem_type
 
unsigned int _p_level
 
QBaseqrule
 
bool shapes_on_quadrature
 

Static Protected Attributes

static Counts _counts
 
static Threads::atomic< unsigned int > _n_objects
 
static Threads::spin_mutex _mutex
 
static bool _enable_print_counter = true
 

Friends

template<unsigned int friend_Dim, FEFamily friend_T_radial, InfMapType friend_T_map>
class InfFE
 

Detailed Description

template<unsigned int Dim, FEFamily T>
class libMesh::FE< Dim, T >

Template class which generates the different FE families and orders.

A specific instatiation of the FEBase class. This class is templated, and specific template instantiations will result in different Finite Element families. Full specialization of the template for specific dimensions(Dim) and families (T) provide support for specific finite element types. The use of templates allows for compile-time optimization, however it requires that the specific finite element family and dimension is also known at compile time. If this is too restricting for your application you can use the FEBase::build() member to create abstract (but still optimized) finite elements.

Author
Benjamin S. Kirk
Date
2002-2007

Definition at line 89 of file fe.h.

Member Typedef Documentation

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts
protectedinherited

Data structure to log the information. The log is identified by the class name.

Definition at line 110 of file reference_counter.h.

Definition at line 135 of file fe_base.h.

Definition at line 133 of file fe_base.h.

Definition at line 136 of file fe_base.h.

Definition at line 139 of file fe_base.h.

Definition at line 137 of file fe_base.h.

Definition at line 138 of file fe_base.h.

template<unsigned int Dim, FEFamily T>
typedef FEGenericBase<typename FEOutputType<T>::type>::OutputShape libMesh::FE< Dim, T >::OutputShape

Definition at line 101 of file fe.h.

Definition at line 134 of file fe_base.h.

Constructor & Destructor Documentation

template<unsigned int Dim, FEFamily T>
libMesh::FE< Dim, T >::FE ( const FEType fet)
inlineexplicit

Constructor.

Definition at line 1048 of file fe.h.

References libMesh::FEAbstract::get_family().

1048  :
1049  FEGenericBase<typename FEOutputType<T>::type> (Dim,fet),
1052 {
1053  // Sanity check. Make sure the
1054  // Family specified in the template instantiation
1055  // matches the one in the FEType object
1056  libmesh_assert_equal_to (T, this->get_family());
1057 }
unsigned int last_edge
Definition: fe.h:478
const unsigned int invalid_uint
Definition: libmesh.h:185
FEFamily get_family() const
Definition: fe_abstract.h:440
ElemType last_side
Definition: fe.h:476

Member Function Documentation

template<unsigned int Dim, FEFamily T>
void libMesh::FE< Dim, T >::attach_quadrature_rule ( QBase q)
virtual

Provides the class with the quadrature rule, which provides the locations (on a reference element) where the shape functions are to be calculated.

Implements libMesh::FEAbstract.

Reimplemented in libMesh::FESubdivision.

Definition at line 44 of file fe.C.

References libMesh::INVALID_ELEM, and libMesh::libmesh_assert().

45 {
46  libmesh_assert(q);
47  this->qrule = q;
48  // make sure we don't cache results from a previous quadrature rule
49  this->elem_type = INVALID_ELEM;
50  return;
51 }
libmesh_assert(remote_elem)
static UniquePtr<FEGenericBase> libMesh::FEGenericBase< FEOutputType< T >::type >::build ( const unsigned int  dim,
const FEType type 
)
staticinherited

Builds a specific finite element type. A UniquePtr<FEGenericBase> is returned to prevent a memory leak. This way the user need not remember to delete the object.

The build call will fail if the OutputType of this class is not compatible with the output required for the requested type

static UniquePtr<FEGenericBase> libMesh::FEGenericBase< FEOutputType< T >::type >::build_InfFE ( const unsigned int  dim,
const FEType type 
)
staticinherited

Builds a specific infinite element type. A UniquePtr<FEGenericBase> is returned to prevent a memory leak. This way the user need not remember to delete the object.

The build call will fail if the OutputShape of this class is not compatible with the output required for the requested type

static void libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values ( const NumericVector< Number > &  global_vector,
const DofMap dof_map,
const Elem coarse_elem,
DenseVector< Number > &  coarse_dofs,
const unsigned int  var,
const bool  use_old_dof_indices = false 
)
staticinherited

Creates a local projection on coarse_elem, based on the DoF values in global_vector for it's children. Computes a vector of coefficients corresponding to dof_indices for only the single given var

static void libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values ( const NumericVector< Number > &  global_vector,
const DofMap dof_map,
const Elem coarse_elem,
DenseVector< Number > &  coarse_dofs,
const bool  use_old_dof_indices = false 
)
staticinherited

Creates a local projection on coarse_elem, based on the DoF values in global_vector for it's children. Computes a vector of coefficients corresponding to all dof_indices.

template<>
void libMesh::FE< 2, SCALAR >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)

Definition at line 122 of file fe_scalar.C.

126 { }
template<>
void libMesh::FE< 3, SCALAR >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)

Definition at line 129 of file fe_scalar.C.

133 { }
template<>
void libMesh::FE< 2, L2_HIERARCHIC >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)

Definition at line 208 of file fe_l2_hierarchic.C.

212 { }
template<>
void libMesh::FE< 3, L2_HIERARCHIC >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)

Definition at line 215 of file fe_l2_hierarchic.C.

219 { }
template<>
void libMesh::FE< 2, CLOUGH >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 313 of file fe_clough.C.

317 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
template<>
void libMesh::FE< 3, CLOUGH >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 320 of file fe_clough.C.

324 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
template<>
void libMesh::FE< 2, HERMITE >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 354 of file fe_hermite.C.

358 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
template<>
void libMesh::FE< 3, HERMITE >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 361 of file fe_hermite.C.

365 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
template<>
void libMesh::FE< 2, HIERARCHIC >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 381 of file fe_hierarchic.C.

385 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
template<>
void libMesh::FE< 3, HIERARCHIC >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 388 of file fe_hierarchic.C.

392 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
template<unsigned int Dim, FEFamily T>
static void libMesh::FE< Dim, T >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
static

Computes the constraint matrix contributions (for non-conforming adapted meshes) corresponding to variable number var_number, using element-specific optimizations if possible.

Referenced by libMesh::FEInterface::compute_constraints().

template<>
void libMesh::FE< 2, MONOMIAL >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)

Definition at line 417 of file fe_monomial.C.

417 {}
template<>
void libMesh::FE< 3, MONOMIAL >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)

Definition at line 418 of file fe_monomial.C.

418 {}
template<>
void libMesh::FE< 2, BERNSTEIN >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 444 of file fe_bernstein.C.

448 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
template<>
void libMesh::FE< 3, BERNSTEIN >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 451 of file fe_bernstein.C.

455 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
template<>
void libMesh::FE< 2, L2_LAGRANGE >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)

Definition at line 496 of file fe_l2_lagrange.C.

500 { }
template<>
void libMesh::FE< 3, L2_LAGRANGE >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)

Definition at line 503 of file fe_l2_lagrange.C.

507 { }
template<>
void libMesh::FE< 0, NEDELEC_ONE >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)

Definition at line 569 of file fe_nedelec_one.C.

573 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
void libMesh::FE< 1, NEDELEC_ONE >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)

Definition at line 576 of file fe_nedelec_one.C.

580 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
void libMesh::FE< 2, NEDELEC_ONE >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 583 of file fe_nedelec_one.C.

587 { nedelec_one_compute_constraints(constraints, dof_map, variable_number, elem, /*Dim=*/2); }
template<>
void libMesh::FE< 3, NEDELEC_ONE >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 590 of file fe_nedelec_one.C.

594 { nedelec_one_compute_constraints(constraints, dof_map, variable_number, elem, /*Dim=*/3); }
template<>
void libMesh::FE< 2, LAGRANGE >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 901 of file fe_lagrange.C.

905 { lagrange_compute_constraints(constraints, dof_map, variable_number, elem, /*Dim=*/2); }
template<>
void libMesh::FE< 3, LAGRANGE >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 908 of file fe_lagrange.C.

912 { lagrange_compute_constraints(constraints, dof_map, variable_number, elem, /*Dim=*/3); }
template<>
void libMesh::FE< 2, XYZ >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)

Definition at line 932 of file fe_xyz.C.

932 {}
template<>
void libMesh::FE< 3, XYZ >::compute_constraints ( DofConstraints ,
DofMap ,
const unsigned  int,
const Elem  
)

Definition at line 933 of file fe_xyz.C.

933 {}
template<>
void libMesh::FE< 2, LAGRANGE_VEC >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 950 of file fe_lagrange_vec.C.

References libMesh::FEGenericBase< OutputType >::compute_proj_constraints().

954 { //libmesh_not_implemented();
955  FEVectorBase::compute_proj_constraints(constraints, dof_map, variable_number, elem);
956 }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Definition: fe_base.C:1384
template<>
void libMesh::FE< 3, LAGRANGE_VEC >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 959 of file fe_lagrange_vec.C.

References libMesh::FEGenericBase< OutputType >::compute_proj_constraints().

963 { //libmesh_not_implemented();
964  FEVectorBase::compute_proj_constraints(constraints, dof_map, variable_number, elem);
965 }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
Definition: fe_base.C:1384
template<>
void libMesh::FE< 2, SZABAB >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 1293 of file fe_szabab.C.

1297 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
template<>
void libMesh::FE< 3, SZABAB >::compute_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)

Definition at line 1300 of file fe_szabab.C.

1304 { compute_proj_constraints(constraints, dof_map, variable_number, elem); }
static void compute_proj_constraints(DofConstraints &constraints, DofMap &dof_map, const unsigned int variable_number, const Elem *elem)
void libMesh::FEAbstract::compute_node_constraints ( NodeConstraints constraints,
const Elem elem 
)
staticinherited

Computes the nodal constraint contributions (for non-conforming adapted meshes), using Lagrange geometry

Definition at line 791 of file fe_abstract.C.

References std::abs(), libMesh::Elem::build_side_ptr(), libMesh::Elem::default_order(), libMesh::Elem::dim(), libMesh::FEAbstract::fe_type, libMesh::FEInterface::inverse_map(), libMesh::LAGRANGE, libMesh::Elem::level(), libMesh::libmesh_assert(), libmesh_nullptr, libMesh::FEInterface::n_dofs(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::parent(), libMesh::Real, libMesh::remote_elem, libMesh::FEInterface::shape(), libMesh::Threads::spin_mtx, and libMesh::Elem::subactive().

793 {
794  libmesh_assert(elem);
795 
796  const unsigned int Dim = elem->dim();
797 
798  // Only constrain elements in 2,3D.
799  if (Dim == 1)
800  return;
801 
802  // Only constrain active and ancestor elements
803  if (elem->subactive())
804  return;
805 
806  // We currently always use LAGRANGE mappings for geometry
807  const FEType fe_type(elem->default_order(), LAGRANGE);
808 
809  std::vector<const Node *> my_nodes, parent_nodes;
810 
811  // Look at the element faces. Check to see if we need to
812  // build constraints.
813  for (unsigned int s=0; s<elem->n_sides(); s++)
814  if (elem->neighbor_ptr(s) != libmesh_nullptr &&
815  elem->neighbor_ptr(s) != remote_elem)
816  if (elem->neighbor_ptr(s)->level() < elem->level()) // constrain dofs shared between
817  { // this element and ones coarser
818  // than this element.
819  // Get pointers to the elements of interest and its parent.
820  const Elem * parent = elem->parent();
821 
822  // This can't happen... Only level-0 elements have NULL
823  // parents, and no level-0 elements can be at a higher
824  // level than their neighbors!
825  libmesh_assert(parent);
826 
827  const UniquePtr<const Elem> my_side (elem->build_side_ptr(s));
828  const UniquePtr<const Elem> parent_side (parent->build_side_ptr(s));
829 
830  const unsigned int n_side_nodes = my_side->n_nodes();
831 
832  my_nodes.clear();
833  my_nodes.reserve (n_side_nodes);
834  parent_nodes.clear();
835  parent_nodes.reserve (n_side_nodes);
836 
837  for (unsigned int n=0; n != n_side_nodes; ++n)
838  my_nodes.push_back(my_side->node_ptr(n));
839 
840  for (unsigned int n=0; n != n_side_nodes; ++n)
841  parent_nodes.push_back(parent_side->node_ptr(n));
842 
843  for (unsigned int my_side_n=0;
844  my_side_n < n_side_nodes;
845  my_side_n++)
846  {
847  libmesh_assert_less (my_side_n, FEInterface::n_dofs(Dim-1, fe_type, my_side->type()));
848 
849  const Node * my_node = my_nodes[my_side_n];
850 
851  // The support point of the DOF
852  const Point & support_point = *my_node;
853 
854  // Figure out where my node lies on their reference element.
855  const Point mapped_point = FEInterface::inverse_map(Dim-1, fe_type,
856  parent_side.get(),
857  support_point);
858 
859  // Compute the parent's side shape function values.
860  for (unsigned int their_side_n=0;
861  their_side_n < n_side_nodes;
862  their_side_n++)
863  {
864  libmesh_assert_less (their_side_n, FEInterface::n_dofs(Dim-1, fe_type, parent_side->type()));
865 
866  const Node * their_node = parent_nodes[their_side_n];
867  libmesh_assert(their_node);
868 
869  const Real their_value = FEInterface::shape(Dim-1,
870  fe_type,
871  parent_side->type(),
872  their_side_n,
873  mapped_point);
874 
875  const Real their_mag = std::abs(their_value);
876 #ifdef DEBUG
877  // Protect for the case u_i ~= u_j,
878  // in which case i better equal j.
879  if (their_mag > 0.999)
880  {
881  libmesh_assert_equal_to (my_node, their_node);
882  libmesh_assert_less (std::abs(their_value - 1.), 0.001);
883  }
884  else
885 #endif
886  // To make nodal constraints useful for constructing
887  // sparsity patterns faster, we need to get EVERY
888  // POSSIBLE constraint coupling identified, even if
889  // there is no coupling in the isoparametric
890  // Lagrange case.
891  if (their_mag < 1.e-5)
892  {
893  // since we may be running this method concurrently
894  // on multiple threads we need to acquire a lock
895  // before modifying the shared constraint_row object.
896  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
897 
898  // A reference to the constraint row.
899  NodeConstraintRow & constraint_row = constraints[my_node].first;
900 
901  constraint_row.insert(std::make_pair (their_node,
902  0.));
903  }
904  // To get nodal coordinate constraints right, only
905  // add non-zero and non-identity values for Lagrange
906  // basis functions.
907  else // (1.e-5 <= their_mag <= .999)
908  {
909  // since we may be running this method concurrently
910  // on multiple threads we need to acquire a lock
911  // before modifying the shared constraint_row object.
912  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
913 
914  // A reference to the constraint row.
915  NodeConstraintRow & constraint_row = constraints[my_node].first;
916 
917  constraint_row.insert(std::make_pair (their_node,
918  their_value));
919  }
920  }
921  }
922  }
923 }
double abs(double a)
static unsigned int n_dofs(const unsigned int dim, const FEType &fe_t, const ElemType t)
Definition: fe_interface.C:414
libmesh_assert(remote_elem)
const class libmesh_nullptr_t libmesh_nullptr
spin_mutex spin_mtx
Definition: threads.C:29
static Real shape(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int i, const Point &p)
Definition: fe_interface.C:628
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_interface.C:556
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::map< const Node *, Real, std::less< const Node * >, Threads::scalable_allocator< std::pair< const Node *const, Real > > > NodeConstraintRow
Definition: dof_map.h:136
const RemoteElem * remote_elem
Definition: remote_elem.C:57
static void libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints ( DofConstraints constraints,
DofMap dof_map,
const PeriodicBoundaries boundaries,
const MeshBase mesh,
const PointLocatorBase point_locator,
const unsigned int  variable_number,
const Elem elem 
)
staticinherited

Computes the constraint matrix contributions (for meshes with periodic boundary conditions) corresponding to variable number var_number, using generic projections.

void libMesh::FEAbstract::compute_periodic_node_constraints ( NodeConstraints constraints,
const PeriodicBoundaries boundaries,
const MeshBase mesh,
const PointLocatorBase point_locator,
const Elem elem 
)
staticinherited

Computes the node position constraint equation contributions (for meshes with periodic boundary conditions)

Definition at line 934 of file fe_abstract.C.

References libMesh::Elem::active(), libMesh::PeriodicBoundaries::boundary(), libMesh::BoundaryInfo::boundary_ids(), libMesh::Elem::build_side_ptr(), libMesh::Elem::default_order(), libMesh::Elem::dim(), libMesh::FEAbstract::fe_type, libMesh::MeshBase::get_boundary_info(), libMesh::PeriodicBoundaryBase::get_corresponding_pos(), libMesh::invalid_uint, libMesh::FEInterface::inverse_map(), libMesh::LAGRANGE, libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::FEInterface::n_dofs(), libMesh::Elem::n_sides(), libMesh::PeriodicBoundaries::neighbor(), libMesh::Elem::neighbor_ptr(), libMesh::PeriodicBoundaryBase::pairedboundary, libMesh::Real, libMesh::FEInterface::shape(), libMesh::BoundaryInfo::side_with_boundary_id(), and libMesh::Threads::spin_mtx.

939 {
940  // Only bother if we truly have periodic boundaries
941  if (boundaries.empty())
942  return;
943 
944  libmesh_assert(elem);
945 
946  // Only constrain active elements with this method
947  if (!elem->active())
948  return;
949 
950  const unsigned int Dim = elem->dim();
951 
952  // We currently always use LAGRANGE mappings for geometry
953  const FEType fe_type(elem->default_order(), LAGRANGE);
954 
955  std::vector<const Node *> my_nodes, neigh_nodes;
956 
957  // Look at the element faces. Check to see if we need to
958  // build constraints.
959  std::vector<boundary_id_type> bc_ids;
960  for (unsigned short int s=0; s<elem->n_sides(); s++)
961  {
962  if (elem->neighbor_ptr(s))
963  continue;
964 
965  mesh.get_boundary_info().boundary_ids (elem, s, bc_ids);
966  for (std::vector<boundary_id_type>::const_iterator id_it=bc_ids.begin(); id_it!=bc_ids.end(); ++id_it)
967  {
968  const boundary_id_type boundary_id = *id_it;
969  const PeriodicBoundaryBase * periodic = boundaries.boundary(boundary_id);
970  if (periodic)
971  {
972  libmesh_assert(point_locator);
973 
974  // Get pointers to the element's neighbor.
975  const Elem * neigh = boundaries.neighbor(boundary_id, *point_locator, elem, s);
976 
977  // h refinement constraints:
978  // constrain dofs shared between
979  // this element and ones as coarse
980  // as or coarser than this element.
981  if (neigh->level() <= elem->level())
982  {
983  unsigned int s_neigh =
984  mesh.get_boundary_info().side_with_boundary_id(neigh, periodic->pairedboundary);
985  libmesh_assert_not_equal_to (s_neigh, libMesh::invalid_uint);
986 
987 #ifdef LIBMESH_ENABLE_AMR
988  libmesh_assert(neigh->active());
989 #endif // #ifdef LIBMESH_ENABLE_AMR
990 
991  const UniquePtr<const Elem> my_side (elem->build_side_ptr(s));
992  const UniquePtr<const Elem> neigh_side (neigh->build_side_ptr(s_neigh));
993 
994  const unsigned int n_side_nodes = my_side->n_nodes();
995 
996  my_nodes.clear();
997  my_nodes.reserve (n_side_nodes);
998  neigh_nodes.clear();
999  neigh_nodes.reserve (n_side_nodes);
1000 
1001  for (unsigned int n=0; n != n_side_nodes; ++n)
1002  my_nodes.push_back(my_side->node_ptr(n));
1003 
1004  for (unsigned int n=0; n != n_side_nodes; ++n)
1005  neigh_nodes.push_back(neigh_side->node_ptr(n));
1006 
1007  // Make sure we're not adding recursive constraints
1008  // due to the redundancy in the way we add periodic
1009  // boundary constraints, or adding constraints to
1010  // nodes that already have AMR constraints
1011  std::vector<bool> skip_constraint(n_side_nodes, false);
1012 
1013  for (unsigned int my_side_n=0;
1014  my_side_n < n_side_nodes;
1015  my_side_n++)
1016  {
1017  libmesh_assert_less (my_side_n, FEInterface::n_dofs(Dim-1, fe_type, my_side->type()));
1018 
1019  const Node * my_node = my_nodes[my_side_n];
1020 
1021  // Figure out where my node lies on their reference element.
1022  const Point neigh_point = periodic->get_corresponding_pos(*my_node);
1023 
1024  const Point mapped_point = FEInterface::inverse_map(Dim-1, fe_type,
1025  neigh_side.get(),
1026  neigh_point);
1027 
1028  // If we've already got a constraint on this
1029  // node, then the periodic constraint is
1030  // redundant
1031  {
1032  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
1033 
1034  if (constraints.count(my_node))
1035  {
1036  skip_constraint[my_side_n] = true;
1037  continue;
1038  }
1039  }
1040 
1041  // Compute the neighbors's side shape function values.
1042  for (unsigned int their_side_n=0;
1043  their_side_n < n_side_nodes;
1044  their_side_n++)
1045  {
1046  libmesh_assert_less (their_side_n, FEInterface::n_dofs(Dim-1, fe_type, neigh_side->type()));
1047 
1048  const Node * their_node = neigh_nodes[their_side_n];
1049 
1050  // If there's a constraint on an opposing node,
1051  // we need to see if it's constrained by
1052  // *our side* making any periodic constraint
1053  // on us recursive
1054  {
1055  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
1056 
1057  if (!constraints.count(their_node))
1058  continue;
1059 
1060  const NodeConstraintRow & their_constraint_row =
1061  constraints[their_node].first;
1062 
1063  for (unsigned int orig_side_n=0;
1064  orig_side_n < n_side_nodes;
1065  orig_side_n++)
1066  {
1067  libmesh_assert_less (orig_side_n, FEInterface::n_dofs(Dim-1, fe_type, my_side->type()));
1068 
1069  const Node * orig_node = my_nodes[orig_side_n];
1070 
1071  if (their_constraint_row.count(orig_node))
1072  skip_constraint[orig_side_n] = true;
1073  }
1074  }
1075  }
1076  }
1077  for (unsigned int my_side_n=0;
1078  my_side_n < n_side_nodes;
1079  my_side_n++)
1080  {
1081  libmesh_assert_less (my_side_n, FEInterface::n_dofs(Dim-1, fe_type, my_side->type()));
1082 
1083  if (skip_constraint[my_side_n])
1084  continue;
1085 
1086  const Node * my_node = my_nodes[my_side_n];
1087 
1088  // Figure out where my node lies on their reference element.
1089  const Point neigh_point = periodic->get_corresponding_pos(*my_node);
1090 
1091  // Figure out where my node lies on their reference element.
1092  const Point mapped_point = FEInterface::inverse_map(Dim-1, fe_type,
1093  neigh_side.get(),
1094  neigh_point);
1095 
1096  for (unsigned int their_side_n=0;
1097  their_side_n < n_side_nodes;
1098  their_side_n++)
1099  {
1100  libmesh_assert_less (their_side_n, FEInterface::n_dofs(Dim-1, fe_type, neigh_side->type()));
1101 
1102  const Node * their_node = neigh_nodes[their_side_n];
1103  libmesh_assert(their_node);
1104 
1105  const Real their_value = FEInterface::shape(Dim-1,
1106  fe_type,
1107  neigh_side->type(),
1108  their_side_n,
1109  mapped_point);
1110 
1111  // since we may be running this method concurrently
1112  // on multiple threads we need to acquire a lock
1113  // before modifying the shared constraint_row object.
1114  {
1115  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
1116 
1117  NodeConstraintRow & constraint_row =
1118  constraints[my_node].first;
1119 
1120  constraint_row.insert(std::make_pair(their_node,
1121  their_value));
1122  }
1123  }
1124  }
1125  }
1126  }
1127  }
1128  }
1129 }
static unsigned int n_dofs(const unsigned int dim, const FEType &fe_t, const ElemType t)
Definition: fe_interface.C:414
const unsigned int invalid_uint
Definition: libmesh.h:185
libmesh_assert(remote_elem)
MeshBase & mesh
spin_mutex spin_mtx
Definition: threads.C:29
int8_t boundary_id_type
Definition: id_types.h:51
static Real shape(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int i, const Point &p)
Definition: fe_interface.C:628
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_interface.C:556
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::map< const Node *, Real, std::less< const Node * >, Threads::scalable_allocator< std::pair< const Node *const, Real > > > NodeConstraintRow
Definition: dof_map.h:136
static void libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints ( DofConstraints constraints,
DofMap dof_map,
const unsigned int  variable_number,
const Elem elem 
)
staticinherited

Computes the constraint matrix contributions (for non-conforming adapted meshes) corresponding to variable number var_number, using generic projections.

virtual void libMesh::FEGenericBase< FEOutputType< T >::type >::compute_shape_functions ( const Elem elem,
const std::vector< Point > &  qp 
)
protectedvirtualinherited

After having updated the jacobian and the transformation from local to global coordinates in FEAbstract::compute_map(), the first derivatives of the shape functions are transformed to global coordinates, giving dphi, dphidx, dphidy, and dphidz. This method should rarely be re-defined in derived classes, but still should be usable for children. Therefore, keep it protected.

Implements libMesh::FEAbstract.

Reimplemented in libMesh::FEXYZ< Dim >.

void libMesh::FEGenericBase< FEOutputType< T >::type >::determine_calculations ( )
protectedinherited

Determine which values are to be calculated, for both the FE itself and for the FEMap.

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 106 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

107 {
108  _enable_print_counter = false;
109  return;
110 }
template<unsigned int Dim, FEFamily T>
void libMesh::FE< Dim, T >::dofs_on_edge ( const Elem *const  elem,
const Order  o,
unsigned int  e,
std::vector< unsigned int > &  di 
)
static

Fills the vector di with the local degree of freedom indices associated with edge e of element elem

On a p-refined element, o should be the base order of the element.

Definition at line 89 of file fe.C.

References libMesh::Elem::is_node_on_edge(), libMesh::libmesh_assert(), libMesh::Elem::n_edges(), n_nodes, libMesh::Elem::n_nodes(), libMesh::Elem::p_level(), and libMesh::Elem::type().

93 {
94  libmesh_assert(elem);
95  libmesh_assert_less (e, elem->n_edges());
96 
97  di.clear();
98  unsigned int nodenum = 0;
99  const unsigned int n_nodes = elem->n_nodes();
100  for (unsigned int n = 0; n != n_nodes; ++n)
101  {
102  const unsigned int n_dofs = n_dofs_at_node(elem->type(),
103  static_cast<Order>(o + elem->p_level()), n);
104  if (elem->is_node_on_edge(n, e))
105  for (unsigned int i = 0; i != n_dofs; ++i)
106  di.push_back(nodenum++);
107  else
108  nodenum += n_dofs;
109  }
110 }
static unsigned int n_dofs(const ElemType t, const Order o)
libmesh_assert(remote_elem)
static unsigned int n_dofs_at_node(const ElemType t, const Order o, const unsigned int n)
const dof_id_type n_nodes
Definition: tecplot_io.C:67
template<>
void libMesh::FE< 2, SUBDIVISION >::dofs_on_edge ( const Elem const,
const Order  ,
unsigned  int,
std::vector< unsigned int > &  di 
)

Definition at line 925 of file fe_subdivision_2D.C.

925 { di.resize(0); }
template<unsigned int Dim, FEFamily T>
void libMesh::FE< Dim, T >::dofs_on_side ( const Elem *const  elem,
const Order  o,
unsigned int  s,
std::vector< unsigned int > &  di 
)
static

Fills the vector di with the local degree of freedom indices associated with side s of element elem

On a p-refined element, o should be the base order of the element.

Definition at line 63 of file fe.C.

References libMesh::Elem::is_node_on_side(), libMesh::libmesh_assert(), n_nodes, libMesh::Elem::n_nodes(), libMesh::Elem::n_sides(), libMesh::Elem::p_level(), and libMesh::Elem::type().

67 {
68  libmesh_assert(elem);
69  libmesh_assert_less (s, elem->n_sides());
70 
71  di.clear();
72  unsigned int nodenum = 0;
73  const unsigned int n_nodes = elem->n_nodes();
74  for (unsigned int n = 0; n != n_nodes; ++n)
75  {
76  const unsigned int n_dofs = n_dofs_at_node(elem->type(),
77  static_cast<Order>(o + elem->p_level()), n);
78  if (elem->is_node_on_side(n, s))
79  for (unsigned int i = 0; i != n_dofs; ++i)
80  di.push_back(nodenum++);
81  else
82  nodenum += n_dofs;
83  }
84 }
static unsigned int n_dofs(const ElemType t, const Order o)
libmesh_assert(remote_elem)
static unsigned int n_dofs_at_node(const ElemType t, const Order o, const unsigned int n)
const dof_id_type n_nodes
Definition: tecplot_io.C:67
template<>
void libMesh::FE< 2, SUBDIVISION >::dofs_on_side ( const Elem const,
const Order  ,
unsigned  int,
std::vector< unsigned int > &  di 
)

Definition at line 924 of file fe_subdivision_2D.C.

924 { di.resize(0); }
template<unsigned int Dim, FEFamily T>
void libMesh::FE< Dim, T >::edge_reinit ( const Elem elem,
const unsigned int  edge,
const Real  tolerance = TOLERANCE,
const std::vector< Point > *const  pts = libmesh_nullptr,
const std::vector< Real > *const  weights = libmesh_nullptr 
)
virtual

Reinitializes all the physical element-dependent data based on the edge. The tolerance paremeter is passed to the involved call to inverse_map(). By default the shape functions and associated data are computed at the quadrature points specified by the quadrature rule qrule, but may be any points specified on the reference side element specified in the optional argument pts.

Implements libMesh::FEAbstract.

Definition at line 260 of file fe_boundary.C.

References libMesh::Elem::build_edge_ptr(), libMesh::libmesh_assert(), libmesh_nullptr, libMesh::Elem::p_level(), and libMesh::Elem::type().

265 {
266  libmesh_assert(elem);
268  // We don't do this for 1D elements!
269  libmesh_assert_not_equal_to (Dim, 1);
270 
271  // We're (possibly re-) calculating now! Time to determine what.
272  // FIXME - we currently just assume that we're using JxW and calling
273  // edge_map later.
274  this->_fe_map->calculations_started = false;
275  this->_fe_map->get_JxW();
276  this->_fe_map->get_xyz();
277  this->determine_calculations();
278 
279  // Build the side of interest
280  const UniquePtr<const Elem> edge(elem->build_edge_ptr(e));
281 
282  // Initialize the shape functions at the user-specified
283  // points
284  if (pts != libmesh_nullptr)
285  {
286  // The shape functions do not correspond to the qrule
287  this->shapes_on_quadrature = false;
288 
289  // Initialize the edge shape functions
290  this->_fe_map->template init_edge_shape_functions<Dim> (*pts, edge.get());
291 
292  // Compute the Jacobian*Weight on the face for integration
293  if (weights != libmesh_nullptr)
294  {
295  this->_fe_map->compute_edge_map (Dim, *weights, edge.get());
296  }
297  else
298  {
299  std::vector<Real> dummy_weights (pts->size(), 1.);
300  this->_fe_map->compute_edge_map (Dim, dummy_weights, edge.get());
301  }
302  }
303  // If there are no user specified points, we use the
304  // quadrature rule
305  else
306  {
307  // initialize quadrature rule
308  this->qrule->init(edge->type(), elem->p_level());
309 
310  if(this->qrule->shapes_need_reinit())
311  this->shapes_on_quadrature = false;
312 
313  // We might not need to reinitialize the shape functions
314  if ((this->get_type() != elem->type()) ||
315  (edge->type() != static_cast<int>(last_edge)) || // Comparison between enum and unsigned, cast the unsigned to int
316  this->shapes_need_reinit() ||
317  !this->shapes_on_quadrature)
318  {
319  // Set the element type
320  this->elem_type = elem->type();
321 
322  // Set the last_edge
323  last_edge = edge->type();
324 
325  // Initialize the edge shape functions
326  this->_fe_map->template init_edge_shape_functions<Dim> (this->qrule->get_points(), edge.get());
327  }
328 
329  // Compute the Jacobian*Weight on the face for integration
330  this->_fe_map->compute_edge_map (Dim, this->qrule->get_weights(), edge.get());
331 
332  // The shape functions correspond to the qrule
333  this->shapes_on_quadrature = true;
334  }
335 
336  // make a copy of the Jacobian for integration
337  const std::vector<Real> JxW_int(this->_fe_map->get_JxW());
338 
339  // Find where the integration points are located on the
340  // full element.
341  std::vector<Point> qp;
342  this->inverse_map (elem, this->_fe_map->get_xyz(), qp, tolerance);
343 
344  // compute the shape function and derivative values
345  // at the points qp
346  this->reinit (elem, &qp);
347 
348  // copy back old data
349  this->_fe_map->get_JxW() = JxW_int;
350 }
virtual void init(const ElemType type=INVALID_ELEM, unsigned int p_level=0)
Definition: quadrature.C:28
virtual bool shapes_need_reinit()
Definition: quadrature.h:210
unsigned int last_edge
Definition: fe.h:478
virtual bool shapes_need_reinit() const libmesh_override
libmesh_assert(remote_elem)
const class libmesh_nullptr_t libmesh_nullptr
ElemType get_type() const
Definition: fe_abstract.h:403
const std::vector< Real > & get_weights() const
Definition: quadrature.h:140
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
virtual void reinit(const Elem *elem, const std::vector< Point > *const pts=libmesh_nullptr, const std::vector< Real > *const weights=libmesh_nullptr) libmesh_override
Definition: fe.C:115
const std::vector< Point > & get_points() const
Definition: quadrature.h:129
static Point inverse_map(const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_map.C:1566
template<>
void libMesh::FE< 2, SUBDIVISION >::edge_reinit ( Elem const *  elem,
unsigned  edge,
Real  tolerance,
const std::vector< Point > *  pts,
const std::vector< Real > *  weights 
)
virtual

Reinitializes all the physical element-dependent data based on the edge of the element elem. The tolerance paremeter is passed to the involved call to inverse_map(). By default the element data are computed at the quadrature points specified by the quadrature rule qrule, but any set of points on the reference edge element may be specified in the optional argument pts.

Implements libMesh::FEAbstract.

Definition at line 884 of file fe_subdivision_2D.C.

889 {
890  libmesh_not_implemented();
891 }
void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

Methods to enable/disable the reference counter output from print_info()

Definition at line 100 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

101 {
102  _enable_print_counter = true;
103  return;
104 }
template<>
FEContinuity libMesh::FE< 0, SCALAR >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 107 of file fe_scalar.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 1, SCALAR >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 108 of file fe_scalar.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 2, SCALAR >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 109 of file fe_scalar.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 3, SCALAR >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 110 of file fe_scalar.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 0, L2_HIERARCHIC >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 194 of file fe_l2_hierarchic.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 1, L2_HIERARCHIC >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 195 of file fe_l2_hierarchic.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 2, L2_HIERARCHIC >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 196 of file fe_l2_hierarchic.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 3, L2_HIERARCHIC >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 197 of file fe_l2_hierarchic.C.

References libMesh::DISCONTINUOUS.

template<unsigned int Dim, FEFamily T>
virtual FEContinuity libMesh::FE< Dim, T >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

template<>
FEContinuity libMesh::FE< 0, CLOUGH >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 299 of file fe_clough.C.

References libMesh::C_ONE.

299 { return C_ONE; }
template<>
FEContinuity libMesh::FE< 1, CLOUGH >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 300 of file fe_clough.C.

References libMesh::C_ONE.

300 { return C_ONE; }
template<>
FEContinuity libMesh::FE< 2, CLOUGH >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 301 of file fe_clough.C.

References libMesh::C_ONE.

301 { return C_ONE; }
template<>
FEContinuity libMesh::FE< 3, CLOUGH >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 302 of file fe_clough.C.

References libMesh::C_ONE.

302 { return C_ONE; }
template<>
FEContinuity libMesh::FE< 0, HERMITE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 339 of file fe_hermite.C.

References libMesh::C_ONE.

339 { return C_ONE; }
template<>
FEContinuity libMesh::FE< 1, HERMITE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 340 of file fe_hermite.C.

References libMesh::C_ONE.

340 { return C_ONE; }
template<>
FEContinuity libMesh::FE< 2, HERMITE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 341 of file fe_hermite.C.

References libMesh::C_ONE.

341 { return C_ONE; }
template<>
FEContinuity libMesh::FE< 3, HERMITE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 342 of file fe_hermite.C.

References libMesh::C_ONE.

342 { return C_ONE; }
template<>
FEContinuity libMesh::FE< 0, HIERARCHIC >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 367 of file fe_hierarchic.C.

References libMesh::C_ZERO.

367 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 1, HIERARCHIC >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 368 of file fe_hierarchic.C.

References libMesh::C_ZERO.

368 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 2, HIERARCHIC >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 369 of file fe_hierarchic.C.

References libMesh::C_ZERO.

369 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 3, HIERARCHIC >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 370 of file fe_hierarchic.C.

References libMesh::C_ZERO.

370 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 0, MONOMIAL >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 400 of file fe_monomial.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 1, MONOMIAL >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 401 of file fe_monomial.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 2, MONOMIAL >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 402 of file fe_monomial.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 3, MONOMIAL >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 403 of file fe_monomial.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 0, BERNSTEIN >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 430 of file fe_bernstein.C.

References libMesh::C_ZERO.

430 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 1, BERNSTEIN >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 431 of file fe_bernstein.C.

References libMesh::C_ZERO.

431 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 2, BERNSTEIN >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 432 of file fe_bernstein.C.

References libMesh::C_ZERO.

432 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 3, BERNSTEIN >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 433 of file fe_bernstein.C.

References libMesh::C_ZERO.

433 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 0, L2_LAGRANGE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 475 of file fe_l2_lagrange.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 1, L2_LAGRANGE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 476 of file fe_l2_lagrange.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 2, L2_LAGRANGE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 477 of file fe_l2_lagrange.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 3, L2_LAGRANGE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 478 of file fe_l2_lagrange.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 0, NEDELEC_ONE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 550 of file fe_nedelec_one.C.

550 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
FEContinuity libMesh::FE< 1, NEDELEC_ONE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 551 of file fe_nedelec_one.C.

551 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
FEContinuity libMesh::FE< 2, NEDELEC_ONE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 552 of file fe_nedelec_one.C.

References libMesh::H_CURL.

552 { return H_CURL; }
template<>
FEContinuity libMesh::FE< 3, NEDELEC_ONE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 553 of file fe_nedelec_one.C.

References libMesh::H_CURL.

553 { return H_CURL; }
template<>
FEContinuity libMesh::FE< 0, LAGRANGE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 878 of file fe_lagrange.C.

References libMesh::C_ZERO.

878 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 1, LAGRANGE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 879 of file fe_lagrange.C.

References libMesh::C_ZERO.

879 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 2, LAGRANGE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 880 of file fe_lagrange.C.

References libMesh::C_ZERO.

880 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 3, LAGRANGE >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 881 of file fe_lagrange.C.

References libMesh::C_ZERO.

881 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 0, XYZ >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 915 of file fe_xyz.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 1, XYZ >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 916 of file fe_xyz.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 2, XYZ >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 917 of file fe_xyz.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 3, XYZ >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 918 of file fe_xyz.C.

References libMesh::DISCONTINUOUS.

template<>
FEContinuity libMesh::FE< 0, LAGRANGE_VEC >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 927 of file fe_lagrange_vec.C.

References libMesh::C_ZERO.

927 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 2, SUBDIVISION >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 928 of file fe_subdivision_2D.C.

References libMesh::C_ONE.

928 { return C_ONE; }
template<>
FEContinuity libMesh::FE< 1, LAGRANGE_VEC >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 928 of file fe_lagrange_vec.C.

References libMesh::C_ZERO.

928 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 2, LAGRANGE_VEC >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 929 of file fe_lagrange_vec.C.

References libMesh::C_ZERO.

929 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 3, LAGRANGE_VEC >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 930 of file fe_lagrange_vec.C.

References libMesh::C_ZERO.

930 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 0, SZABAB >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 1279 of file fe_szabab.C.

References libMesh::C_ZERO.

1279 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 1, SZABAB >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 1280 of file fe_szabab.C.

References libMesh::C_ZERO.

1280 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 2, SZABAB >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 1281 of file fe_szabab.C.

References libMesh::C_ZERO.

1281 { return C_ZERO; }
template<>
FEContinuity libMesh::FE< 3, SZABAB >::get_continuity ( ) const
virtual
Returns
the continuity level of the finite element.

Implements libMesh::FEAbstract.

Definition at line 1282 of file fe_szabab.C.

References libMesh::C_ZERO.

1282 { return C_ZERO; }
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_curl_phi ( ) const
inlineinherited
const std::vector<Real>& libMesh::FEAbstract::get_curvatures ( ) const
inlineinherited
Returns
the curvatures for use in face integration.

Definition at line 376 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

377  { return this->_fe_map->get_curvatures();}
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<std::vector<OutputTensor> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phi ( ) const
inlineinherited
Returns
the shape function second derivatives at the quadrature points.

Definition at line 302 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::d2phi, and libMesh::libmesh_assert().

304  calculate_d2phi = calculate_dphiref = true; return d2phi; }
std::vector< std::vector< OutputTensor > > d2phi
Definition: fe_base.h:564
libmesh_assert(remote_elem)
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phideta2 ( ) const
inlineinherited
Returns
the shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 382 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::d2phideta2, and libMesh::libmesh_assert().

384  calculate_d2phi = calculate_dphiref = true; return d2phideta2; }
libmesh_assert(remote_elem)
std::vector< std::vector< OutputShape > > d2phideta2
Definition: fe_base.h:584
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidetadzeta ( ) const
inlineinherited
Returns
the shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 390 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::d2phidetadzeta, and libMesh::libmesh_assert().

libmesh_assert(remote_elem)
std::vector< std::vector< OutputShape > > d2phidetadzeta
Definition: fe_base.h:589
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidx2 ( ) const
inlineinherited
Returns
the shape function second derivatives at the quadrature points.

Definition at line 310 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::d2phidx2, and libMesh::libmesh_assert().

312  calculate_d2phi = calculate_dphiref = true; return d2phidx2; }
libmesh_assert(remote_elem)
std::vector< std::vector< OutputShape > > d2phidx2
Definition: fe_base.h:599
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdy ( ) const
inlineinherited
Returns
the shape function second derivatives at the quadrature points.

Definition at line 318 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::d2phidxdy, and libMesh::libmesh_assert().

320  calculate_d2phi = calculate_dphiref = true; return d2phidxdy; }
libmesh_assert(remote_elem)
std::vector< std::vector< OutputShape > > d2phidxdy
Definition: fe_base.h:604
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdz ( ) const
inlineinherited
Returns
the shape function second derivatives at the quadrature points.

Definition at line 326 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::d2phidxdz, and libMesh::libmesh_assert().

328  calculate_d2phi = calculate_dphiref = true; return d2phidxdz; }
std::vector< std::vector< OutputShape > > d2phidxdz
Definition: fe_base.h:609
libmesh_assert(remote_elem)
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxi2 ( ) const
inlineinherited
Returns
the shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 358 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::d2phidxi2, and libMesh::libmesh_assert().

360  calculate_d2phi = calculate_dphiref = true; return d2phidxi2; }
libmesh_assert(remote_elem)
std::vector< std::vector< OutputShape > > d2phidxi2
Definition: fe_base.h:569
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxideta ( ) const
inlineinherited
Returns
the shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 366 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::d2phidxideta, and libMesh::libmesh_assert().

libmesh_assert(remote_elem)
std::vector< std::vector< OutputShape > > d2phidxideta
Definition: fe_base.h:574
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxidzeta ( ) const
inlineinherited
Returns
the shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 374 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::d2phidxidzeta, and libMesh::libmesh_assert().

libmesh_assert(remote_elem)
std::vector< std::vector< OutputShape > > d2phidxidzeta
Definition: fe_base.h:579
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidy2 ( ) const
inlineinherited
Returns
the shape function second derivatives at the quadrature points.

Definition at line 334 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::d2phidy2, and libMesh::libmesh_assert().

336  calculate_d2phi = calculate_dphiref = true; return d2phidy2; }
libmesh_assert(remote_elem)
std::vector< std::vector< OutputShape > > d2phidy2
Definition: fe_base.h:614
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidydz ( ) const
inlineinherited
Returns
the shape function second derivatives at the quadrature points.

Definition at line 342 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::d2phidydz, and libMesh::libmesh_assert().

344  calculate_d2phi = calculate_dphiref = true; return d2phidydz; }
std::vector< std::vector< OutputShape > > d2phidydz
Definition: fe_base.h:619
libmesh_assert(remote_elem)
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidz2 ( ) const
inlineinherited
Returns
the shape function second derivatives at the quadrature points.

Definition at line 350 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::d2phidz2, and libMesh::libmesh_assert().

352  calculate_d2phi = calculate_dphiref = true; return d2phidz2; }
libmesh_assert(remote_elem)
std::vector< std::vector< OutputShape > > d2phidz2
Definition: fe_base.h:624
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidzeta2 ( ) const
inlineinherited
Returns
the shape function second derivatives at the quadrature points, in reference coordinates

Definition at line 398 of file fe_base.h.

References libMesh::FEAbstract::calculate_d2phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::d2phidzeta2, and libMesh::libmesh_assert().

400  calculate_d2phi = calculate_dphiref = true; return d2phidzeta2; }
libmesh_assert(remote_elem)
std::vector< std::vector< OutputShape > > d2phidzeta2
Definition: fe_base.h:594
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdeta2 ( ) const
inlineinherited
Returns
the second partial derivatives in eta.

Definition at line 263 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

264  { return this->_fe_map->get_d2xyzdeta2(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdetadzeta ( ) const
inlineinherited
Returns
the second partial derivatives in eta-zeta.

Definition at line 293 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

294  { return this->_fe_map->get_d2xyzdetadzeta(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdxi2 ( ) const
inlineinherited
Returns
the second partial derivatives in xi.

Definition at line 257 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

258  { return this->_fe_map->get_d2xyzdxi2(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdxideta ( ) const
inlineinherited
Returns
the second partial derivatives in xi-eta.

Definition at line 279 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

280  { return this->_fe_map->get_d2xyzdxideta(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdxidzeta ( ) const
inlineinherited
Returns
the second partial derivatives in xi-zeta.

Definition at line 287 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

288  { return this->_fe_map->get_d2xyzdxidzeta(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<RealGradient>& libMesh::FEAbstract::get_d2xyzdzeta2 ( ) const
inlineinherited
Returns
the second partial derivatives in zeta.

Definition at line 271 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

272  { return this->_fe_map->get_d2xyzdzeta2(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<Real>& libMesh::FEAbstract::get_detadx ( ) const
inlineinherited
Returns
the deta/dx entry in the transformation matrix from physical to local coordinates.

Definition at line 323 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

324  { return this->_fe_map->get_detadx(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<Real>& libMesh::FEAbstract::get_detady ( ) const
inlineinherited
Returns
the deta/dy entry in the transformation matrix from physical to local coordinates.

Definition at line 330 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

331  { return this->_fe_map->get_detady(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<Real>& libMesh::FEAbstract::get_detadz ( ) const
inlineinherited
Returns
the deta/dz entry in the transformation matrix from physical to local coordinates.

Definition at line 337 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

338  { return this->_fe_map->get_detadz(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<std::vector<OutputDivergence> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_div_phi ( ) const
inlineinherited
Returns
the divergence of the shape function at the quadrature points.

Definition at line 244 of file fe_base.h.

References libMesh::FEAbstract::calculate_div_phi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::div_phi, and libMesh::libmesh_assert().

246  calculate_div_phi = calculate_dphiref = true; return div_phi; }
libmesh_assert(remote_elem)
std::vector< std::vector< OutputDivergence > > div_phi
Definition: fe_base.h:526
const std::vector<OutputGradient>& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphase ( ) const
inlineinherited
Returns
the global first derivative of the phase term which is used in infinite elements, evaluated at the quadrature points.

In case of the general finite element class FE this field is initialized to all zero, so that the variational formulation for an infinite element returns correct element matrices for a mesh using both finite and infinite elements.

Definition at line 416 of file fe_base.h.

References libMesh::FEGenericBase< OutputType >::dphase.

417  { return dphase; }
std::vector< OutputGradient > dphase
Definition: fe_base.h:642
const std::vector<std::vector<OutputGradient> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphi ( ) const
inlineinherited
Returns
the shape function derivatives at the quadrature points.

Definition at line 228 of file fe_base.h.

References libMesh::FEAbstract::calculate_dphi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::dphi, and libMesh::libmesh_assert().

230  calculate_dphi = calculate_dphiref = true; return dphi; }
libmesh_assert(remote_elem)
std::vector< std::vector< OutputGradient > > dphi
Definition: fe_base.h:516
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphideta ( ) const
inlineinherited
Returns
the shape function eta-derivative at the quadrature points.

Definition at line 284 of file fe_base.h.

References libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::dphideta, and libMesh::libmesh_assert().

286  calculate_dphiref = true; return dphideta; }
libmesh_assert(remote_elem)
std::vector< std::vector< OutputShape > > dphideta
Definition: fe_base.h:536
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidx ( ) const
inlineinherited
Returns
the shape function x-derivative at the quadrature points.

Definition at line 252 of file fe_base.h.

References libMesh::FEAbstract::calculate_dphi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::dphidx, and libMesh::libmesh_assert().

254  calculate_dphi = calculate_dphiref = true; return dphidx; }
libmesh_assert(remote_elem)
std::vector< std::vector< OutputShape > > dphidx
Definition: fe_base.h:546
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidxi ( ) const
inlineinherited
Returns
the shape function xi-derivative at the quadrature points.

Definition at line 276 of file fe_base.h.

References libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::dphidxi, and libMesh::libmesh_assert().

278  calculate_dphiref = true; return dphidxi; }
std::vector< std::vector< OutputShape > > dphidxi
Definition: fe_base.h:531
libmesh_assert(remote_elem)
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidy ( ) const
inlineinherited
Returns
the shape function y-derivative at the quadrature points.

Definition at line 260 of file fe_base.h.

References libMesh::FEAbstract::calculate_dphi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::dphidy, and libMesh::libmesh_assert().

262  calculate_dphi = calculate_dphiref = true; return dphidy; }
libmesh_assert(remote_elem)
std::vector< std::vector< OutputShape > > dphidy
Definition: fe_base.h:551
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidz ( ) const
inlineinherited
Returns
the shape function z-derivative at the quadrature points.

Definition at line 268 of file fe_base.h.

References libMesh::FEAbstract::calculate_dphi, libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::dphidz, and libMesh::libmesh_assert().

270  calculate_dphi = calculate_dphiref = true; return dphidz; }
libmesh_assert(remote_elem)
std::vector< std::vector< OutputShape > > dphidz
Definition: fe_base.h:556
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidzeta ( ) const
inlineinherited
Returns
the shape function zeta-derivative at the quadrature points.

Definition at line 292 of file fe_base.h.

References libMesh::FEAbstract::calculate_dphiref, libMesh::FEAbstract::calculations_started, libMesh::FEGenericBase< OutputType >::dphidzeta, and libMesh::libmesh_assert().

294  calculate_dphiref = true; return dphidzeta; }
std::vector< std::vector< OutputShape > > dphidzeta
Definition: fe_base.h:541
libmesh_assert(remote_elem)
const std::vector<Real>& libMesh::FEAbstract::get_dxidx ( ) const
inlineinherited
Returns
the dxi/dx entry in the transformation matrix from physical to local coordinates.

Definition at line 302 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

303  { return this->_fe_map->get_dxidx(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<Real>& libMesh::FEAbstract::get_dxidy ( ) const
inlineinherited
Returns
the dxi/dy entry in the transformation matrix from physical to local coordinates.

Definition at line 309 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

310  { return this->_fe_map->get_dxidy(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<Real>& libMesh::FEAbstract::get_dxidz ( ) const
inlineinherited
Returns
the dxi/dz entry in the transformation matrix from physical to local coordinates.

Definition at line 316 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

317  { return this->_fe_map->get_dxidz(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<RealGradient>& libMesh::FEAbstract::get_dxyzdeta ( ) const
inlineinherited
Returns
the element tangents in eta-direction at the quadrature points.

Definition at line 244 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

245  { return this->_fe_map->get_dxyzdeta(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<RealGradient>& libMesh::FEAbstract::get_dxyzdxi ( ) const
inlineinherited
Returns
the element tangents in xi-direction at the quadrature points.

Definition at line 237 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

238  { return this->_fe_map->get_dxyzdxi(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<RealGradient>& libMesh::FEAbstract::get_dxyzdzeta ( ) const
inlineinherited
Returns
the element tangents in zeta-direction at the quadrature points.

Definition at line 251 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

252  { return _fe_map->get_dxyzdzeta(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<Real>& libMesh::FEAbstract::get_dzetadx ( ) const
inlineinherited
Returns
the dzeta/dx entry in the transformation matrix from physical to local coordinates.

Definition at line 344 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

345  { return this->_fe_map->get_dzetadx(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<Real>& libMesh::FEAbstract::get_dzetady ( ) const
inlineinherited
Returns
the dzeta/dy entry in the transformation matrix from physical to local coordinates.

Definition at line 351 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

352  { return this->_fe_map->get_dzetady(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
const std::vector<Real>& libMesh::FEAbstract::get_dzetadz ( ) const
inlineinherited
Returns
the dzeta/dz entry in the transformation matrix from physical to local coordinates.

Definition at line 358 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

359  { return this->_fe_map->get_dzetadz(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
FEFamily libMesh::FEAbstract::get_family ( ) const
inlineinherited
Returns
the finite element family of this element.

Definition at line 440 of file fe_abstract.h.

References libMesh::FEType::family, and libMesh::FEAbstract::fe_type.

Referenced by libMesh::FE< Dim, T >::FE().

440 { return fe_type.family; }
FEFamily family
Definition: fe_type.h:206
std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

References libMesh::ReferenceCounter::_counts, and libMesh::Quality::name().

Referenced by libMesh::ReferenceCounter::print_info().

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (Counts::iterator it = _counts.begin();
59  it != _counts.end(); ++it)
60  {
61  const std::string name(it->first);
62  const unsigned int creations = it->second.first;
63  const unsigned int destructions = it->second.second;
64 
65  oss << "| " << name << " reference count information:\n"
66  << "| Creations: " << creations << '\n'
67  << "| Destructions: " << destructions << '\n';
68  }
69 
70  oss << " ---------------------------------------------------------------------------- \n";
71 
72  return oss.str();
73 
74 #else
75 
76  return "";
77 
78 #endif
79 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
const std::vector<Point>& libMesh::FEAbstract::get_normals ( ) const
inlineinherited
Order libMesh::FEAbstract::get_order ( ) const
inlineinherited
Returns
the approximation order of the finite element.

Definition at line 419 of file fe_abstract.h.

References libMesh::FEAbstract::_p_level, libMesh::FEAbstract::fe_type, and libMesh::FEType::order.

419 { return static_cast<Order>(fe_type.order + _p_level); }
unsigned int _p_level
Definition: fe_abstract.h:571
OrderWrapper order
Definition: fe_type.h:200
unsigned int libMesh::FEAbstract::get_p_level ( ) const
inlineinherited
Returns
the p refinement level that the current shape functions have been calculated for.

Definition at line 409 of file fe_abstract.h.

References libMesh::FEAbstract::_p_level.

409 { return _p_level; }
unsigned int _p_level
Definition: fe_abstract.h:571
const std::vector<std::vector<OutputShape> >& libMesh::FEGenericBase< FEOutputType< T >::type >::get_phi ( ) const
inlineinherited
Returns
the shape function values at the quadrature points on the element.

Definition at line 220 of file fe_base.h.

References libMesh::FEAbstract::calculate_phi, libMesh::FEAbstract::calculations_started, libMesh::libmesh_assert(), and libMesh::FEGenericBase< OutputType >::phi.

222  calculate_phi = true; return phi; }
libmesh_assert(remote_elem)
std::vector< std::vector< OutputShape > > phi
Definition: fe_base.h:511
void libMesh::FEAbstract::get_refspace_nodes ( const ElemType  t,
std::vector< Point > &  nodes 
)
staticinherited

returns the reference space nodes coordinates given the element type

Definition at line 259 of file fe_abstract.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, and libMesh::TRISHELL3.

260 {
261  switch(itemType)
262  {
263  case EDGE2:
264  {
265  nodes.resize(2);
266  nodes[0] = Point (-1.,0.,0.);
267  nodes[1] = Point (1.,0.,0.);
268  return;
269  }
270  case EDGE3:
271  {
272  nodes.resize(3);
273  nodes[0] = Point (-1.,0.,0.);
274  nodes[1] = Point (1.,0.,0.);
275  nodes[2] = Point (0.,0.,0.);
276  return;
277  }
278  case TRI3:
279  case TRISHELL3:
280  {
281  nodes.resize(3);
282  nodes[0] = Point (0.,0.,0.);
283  nodes[1] = Point (1.,0.,0.);
284  nodes[2] = Point (0.,1.,0.);
285  return;
286  }
287  case TRI6:
288  {
289  nodes.resize(6);
290  nodes[0] = Point (0.,0.,0.);
291  nodes[1] = Point (1.,0.,0.);
292  nodes[2] = Point (0.,1.,0.);
293  nodes[3] = Point (.5,0.,0.);
294  nodes[4] = Point (.5,.5,0.);
295  nodes[5] = Point (0.,.5,0.);
296  return;
297  }
298  case QUAD4:
299  case QUADSHELL4:
300  {
301  nodes.resize(4);
302  nodes[0] = Point (-1.,-1.,0.);
303  nodes[1] = Point (1.,-1.,0.);
304  nodes[2] = Point (1.,1.,0.);
305  nodes[3] = Point (-1.,1.,0.);
306  return;
307  }
308  case QUAD8:
309  {
310  nodes.resize(8);
311  nodes[0] = Point (-1.,-1.,0.);
312  nodes[1] = Point (1.,-1.,0.);
313  nodes[2] = Point (1.,1.,0.);
314  nodes[3] = Point (-1.,1.,0.);
315  nodes[4] = Point (0.,-1.,0.);
316  nodes[5] = Point (1.,0.,0.);
317  nodes[6] = Point (0.,1.,0.);
318  nodes[7] = Point (-1.,0.,0.);
319  return;
320  }
321  case QUAD9:
322  {
323  nodes.resize(9);
324  nodes[0] = Point (-1.,-1.,0.);
325  nodes[1] = Point (1.,-1.,0.);
326  nodes[2] = Point (1.,1.,0.);
327  nodes[3] = Point (-1.,1.,0.);
328  nodes[4] = Point (0.,-1.,0.);
329  nodes[5] = Point (1.,0.,0.);
330  nodes[6] = Point (0.,1.,0.);
331  nodes[7] = Point (-1.,0.,0.);
332  nodes[8] = Point (0.,0.,0.);
333  return;
334  }
335  case TET4:
336  {
337  nodes.resize(4);
338  nodes[0] = Point (0.,0.,0.);
339  nodes[1] = Point (1.,0.,0.);
340  nodes[2] = Point (0.,1.,0.);
341  nodes[3] = Point (0.,0.,1.);
342  return;
343  }
344  case TET10:
345  {
346  nodes.resize(10);
347  nodes[0] = Point (0.,0.,0.);
348  nodes[1] = Point (1.,0.,0.);
349  nodes[2] = Point (0.,1.,0.);
350  nodes[3] = Point (0.,0.,1.);
351  nodes[4] = Point (.5,0.,0.);
352  nodes[5] = Point (.5,.5,0.);
353  nodes[6] = Point (0.,.5,0.);
354  nodes[7] = Point (0.,0.,.5);
355  nodes[8] = Point (.5,0.,.5);
356  nodes[9] = Point (0.,.5,.5);
357  return;
358  }
359  case HEX8:
360  {
361  nodes.resize(8);
362  nodes[0] = Point (-1.,-1.,-1.);
363  nodes[1] = Point (1.,-1.,-1.);
364  nodes[2] = Point (1.,1.,-1.);
365  nodes[3] = Point (-1.,1.,-1.);
366  nodes[4] = Point (-1.,-1.,1.);
367  nodes[5] = Point (1.,-1.,1.);
368  nodes[6] = Point (1.,1.,1.);
369  nodes[7] = Point (-1.,1.,1.);
370  return;
371  }
372  case HEX20:
373  {
374  nodes.resize(20);
375  nodes[0] = Point (-1.,-1.,-1.);
376  nodes[1] = Point (1.,-1.,-1.);
377  nodes[2] = Point (1.,1.,-1.);
378  nodes[3] = Point (-1.,1.,-1.);
379  nodes[4] = Point (-1.,-1.,1.);
380  nodes[5] = Point (1.,-1.,1.);
381  nodes[6] = Point (1.,1.,1.);
382  nodes[7] = Point (-1.,1.,1.);
383  nodes[8] = Point (0.,-1.,-1.);
384  nodes[9] = Point (1.,0.,-1.);
385  nodes[10] = Point (0.,1.,-1.);
386  nodes[11] = Point (-1.,0.,-1.);
387  nodes[12] = Point (-1.,-1.,0.);
388  nodes[13] = Point (1.,-1.,0.);
389  nodes[14] = Point (1.,1.,0.);
390  nodes[15] = Point (-1.,1.,0.);
391  nodes[16] = Point (0.,-1.,1.);
392  nodes[17] = Point (1.,0.,1.);
393  nodes[18] = Point (0.,1.,1.);
394  nodes[19] = Point (-1.,0.,1.);
395  return;
396  }
397  case HEX27:
398  {
399  nodes.resize(27);
400  nodes[0] = Point (-1.,-1.,-1.);
401  nodes[1] = Point (1.,-1.,-1.);
402  nodes[2] = Point (1.,1.,-1.);
403  nodes[3] = Point (-1.,1.,-1.);
404  nodes[4] = Point (-1.,-1.,1.);
405  nodes[5] = Point (1.,-1.,1.);
406  nodes[6] = Point (1.,1.,1.);
407  nodes[7] = Point (-1.,1.,1.);
408  nodes[8] = Point (0.,-1.,-1.);
409  nodes[9] = Point (1.,0.,-1.);
410  nodes[10] = Point (0.,1.,-1.);
411  nodes[11] = Point (-1.,0.,-1.);
412  nodes[12] = Point (-1.,-1.,0.);
413  nodes[13] = Point (1.,-1.,0.);
414  nodes[14] = Point (1.,1.,0.);
415  nodes[15] = Point (-1.,1.,0.);
416  nodes[16] = Point (0.,-1.,1.);
417  nodes[17] = Point (1.,0.,1.);
418  nodes[18] = Point (0.,1.,1.);
419  nodes[19] = Point (-1.,0.,1.);
420  nodes[20] = Point (0.,0.,-1.);
421  nodes[21] = Point (0.,-1.,0.);
422  nodes[22] = Point (1.,0.,0.);
423  nodes[23] = Point (0.,1.,0.);
424  nodes[24] = Point (-1.,0.,0.);
425  nodes[25] = Point (0.,0.,1.);
426  nodes[26] = Point (0.,0.,0.);
427  return;
428  }
429  case PRISM6:
430  {
431  nodes.resize(6);
432  nodes[0] = Point (0.,0.,-1.);
433  nodes[1] = Point (1.,0.,-1.);
434  nodes[2] = Point (0.,1.,-1.);
435  nodes[3] = Point (0.,0.,1.);
436  nodes[4] = Point (1.,0.,1.);
437  nodes[5] = Point (0.,1.,1.);
438  return;
439  }
440  case PRISM15:
441  {
442  nodes.resize(15);
443  nodes[0] = Point (0.,0.,-1.);
444  nodes[1] = Point (1.,0.,-1.);
445  nodes[2] = Point (0.,1.,-1.);
446  nodes[3] = Point (0.,0.,1.);
447  nodes[4] = Point (1.,0.,1.);
448  nodes[5] = Point (0.,1.,1.);
449  nodes[6] = Point (.5,0.,-1.);
450  nodes[7] = Point (.5,.5,-1.);
451  nodes[8] = Point (0.,.5,-1.);
452  nodes[9] = Point (0.,0.,0.);
453  nodes[10] = Point (1.,0.,0.);
454  nodes[11] = Point (0.,1.,0.);
455  nodes[12] = Point (.5,0.,1.);
456  nodes[13] = Point (.5,.5,1.);
457  nodes[14] = Point (0.,.5,1.);
458  return;
459  }
460  case PRISM18:
461  {
462  nodes.resize(18);
463  nodes[0] = Point (0.,0.,-1.);
464  nodes[1] = Point (1.,0.,-1.);
465  nodes[2] = Point (0.,1.,-1.);
466  nodes[3] = Point (0.,0.,1.);
467  nodes[4] = Point (1.,0.,1.);
468  nodes[5] = Point (0.,1.,1.);
469  nodes[6] = Point (.5,0.,-1.);
470  nodes[7] = Point (.5,.5,-1.);
471  nodes[8] = Point (0.,.5,-1.);
472  nodes[9] = Point (0.,0.,0.);
473  nodes[10] = Point (1.,0.,0.);
474  nodes[11] = Point (0.,1.,0.);
475  nodes[12] = Point (.5,0.,1.);
476  nodes[13] = Point (.5,.5,1.);
477  nodes[14] = Point (0.,.5,1.);
478  nodes[15] = Point (.5,0.,0.);
479  nodes[16] = Point (.5,.5,0.);
480  nodes[17] = Point (0.,.5,0.);
481  return;
482  }
483  case PYRAMID5:
484  {
485  nodes.resize(5);
486  nodes[0] = Point (-1.,-1.,0.);
487  nodes[1] = Point (1.,-1.,0.);
488  nodes[2] = Point (1.,1.,0.);
489  nodes[3] = Point (-1.,1.,0.);
490  nodes[4] = Point (0.,0.,1.);
491  return;
492  }
493  case PYRAMID13:
494  {
495  nodes.resize(13);
496 
497  // base corners
498  nodes[0] = Point (-1.,-1.,0.);
499  nodes[1] = Point (1.,-1.,0.);
500  nodes[2] = Point (1.,1.,0.);
501  nodes[3] = Point (-1.,1.,0.);
502 
503  // apex
504  nodes[4] = Point (0.,0.,1.);
505 
506  // base midedge
507  nodes[5] = Point (0.,-1.,0.);
508  nodes[6] = Point (1.,0.,0.);
509  nodes[7] = Point (0.,1.,0.);
510  nodes[8] = Point (-1,0.,0.);
511 
512  // lateral midedge
513  nodes[9] = Point (-.5,-.5,.5);
514  nodes[10] = Point (.5,-.5,.5);
515  nodes[11] = Point (.5,.5,.5);
516  nodes[12] = Point (-.5,.5,.5);
517 
518  return;
519  }
520  case PYRAMID14:
521  {
522  nodes.resize(14);
523 
524  // base corners
525  nodes[0] = Point (-1.,-1.,0.);
526  nodes[1] = Point (1.,-1.,0.);
527  nodes[2] = Point (1.,1.,0.);
528  nodes[3] = Point (-1.,1.,0.);
529 
530  // apex
531  nodes[4] = Point (0.,0.,1.);
532 
533  // base midedge
534  nodes[5] = Point (0.,-1.,0.);
535  nodes[6] = Point (1.,0.,0.);
536  nodes[7] = Point (0.,1.,0.);
537  nodes[8] = Point (-1,0.,0.);
538 
539  // lateral midedge
540  nodes[9] = Point (-.5,-.5,.5);
541  nodes[10] = Point (.5,-.5,.5);
542  nodes[11] = Point (.5,.5,.5);
543  nodes[12] = Point (-.5,.5,.5);
544 
545  // base center
546  nodes[13] = Point (0.,0.,0.);
547 
548  return;
549  }
550 
551  default:
552  libmesh_error_msg("ERROR: Unknown element type " << itemType);
553  }
554 }
const std::vector<RealGradient>& libMesh::FEGenericBase< FEOutputType< T >::type >::get_Sobolev_dweight ( ) const
inlineinherited
Returns
the first global derivative of the multiplicative weight at each quadrature point. See get_Sobolev_weight() for details. In case of FE initialized to all zero.

Definition at line 440 of file fe_base.h.

References libMesh::FEGenericBase< OutputType >::dweight.

441  { return dweight; }
const std::vector<Real>& libMesh::FEGenericBase< FEOutputType< T >::type >::get_Sobolev_weight ( ) const
inlineinherited
Returns
the multiplicative weight at each quadrature point. This weight is used for certain infinite element weak formulations, so that weighted Sobolev spaces are used for the trial function space. This renders the variational form easily computable.

In case of the general finite element class FE this field is initialized to all ones, so that the variational formulation for an infinite element returns correct element matrices for a mesh using both finite and infinite elements.

Definition at line 432 of file fe_base.h.

References libMesh::FEGenericBase< OutputType >::weight.

433  { return weight; }
const std::vector<std::vector<Point> >& libMesh::FEAbstract::get_tangents ( ) const
inlineinherited
Returns
the tangent vectors for face integration.

Definition at line 364 of file fe_abstract.h.

References libMesh::FEAbstract::_fe_map.

365  { return this->_fe_map->get_tangents(); }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
ElemType libMesh::FEAbstract::get_type ( ) const
inlineinherited
Returns
the element type that the current shape functions have been calculated for. Useful in determining when shape functions must be recomputed.

Definition at line 403 of file fe_abstract.h.

References libMesh::FEAbstract::elem_type.

403 { return elem_type; }
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the construction counter. Should be called in the constructor of any derived class that will be reference counted.

Definition at line 160 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

161 {
162  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
163  std::pair<unsigned int, unsigned int> & p = _counts[name];
164 
165  p.first++;
166 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
spin_mutex spin_mtx
Definition: threads.C:29
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the destruction counter. Should be called in the destructor of any derived class that will be reference counted.

Definition at line 173 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

174 {
175  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
176  std::pair<unsigned int, unsigned int> & p = _counts[name];
177 
178  p.second++;
179 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
spin_mutex spin_mtx
Definition: threads.C:29
template<unsigned int Dim, FEFamily T>
void libMesh::FE< Dim, T >::init_base_shape_functions ( const std::vector< Point > &  qp,
const Elem e 
)
protectedvirtual

Initialize the data fields for the base of an an infinite element.

Implements libMesh::FEGenericBase< FEOutputType< T >::type >.

Definition at line 536 of file fe.C.

References libMesh::Elem::type().

538 {
539  this->elem_type = e->type();
540  this->_fe_map->template init_reference_to_physical_map<Dim>(qp, e);
541  init_shape_functions(qp, e);
542 }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
virtual void init_shape_functions(const std::vector< Point > &qp, const Elem *e)
Definition: fe.C:280
template<unsigned int Dim, FEFamily T>
void libMesh::FE< Dim, T >::init_shape_functions ( const std::vector< Point > &  qp,
const Elem e 
)
protectedvirtual

Update the various member data fields phi, dphidxi, dphideta, dphidzeta, etc. for the current element. These data will be computed at the points qp, which are generally (but need not be) the quadrature points.

Reimplemented in libMesh::FEXYZ< Dim >, and libMesh::FESubdivision.

Definition at line 280 of file fe.C.

References libMesh::FEInterface::field_type(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::TYPE_VECTOR, and libMesh::MeshTools::weight().

282 {
283  // Start logging the shape function initialization
284  LOG_SCOPE("init_shape_functions()", "FE");
285 
286  // The number of quadrature points.
287  const unsigned int n_qp = cast_int<unsigned int>(qp.size());
288 
289  // Number of shape functions in the finite element approximation
290  // space.
291  const unsigned int n_approx_shape_functions =
292  this->n_shape_functions(this->get_type(),
293  this->get_order());
294 
295  // resize the vectors to hold current data
296  // Phi are the shape functions used for the FE approximation
297  // Phi_map are the shape functions used for the FE mapping
298  if (this->calculate_phi)
299  this->phi.resize (n_approx_shape_functions);
300 
301  if (this->calculate_dphi)
302  {
303  this->dphi.resize (n_approx_shape_functions);
304  this->dphidx.resize (n_approx_shape_functions);
305  this->dphidy.resize (n_approx_shape_functions);
306  this->dphidz.resize (n_approx_shape_functions);
307  }
308 
309  if(this->calculate_dphiref)
310  {
311  if (Dim > 0)
312  this->dphidxi.resize (n_approx_shape_functions);
313 
314  if (Dim > 1)
315  this->dphideta.resize (n_approx_shape_functions);
316 
317  if (Dim > 2)
318  this->dphidzeta.resize (n_approx_shape_functions);
319  }
320 
322  this->curl_phi.resize(n_approx_shape_functions);
323 
325  this->div_phi.resize(n_approx_shape_functions);
326 
327 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
328  if (this->calculate_d2phi)
329  {
330  this->d2phi.resize (n_approx_shape_functions);
331  this->d2phidx2.resize (n_approx_shape_functions);
332  this->d2phidxdy.resize (n_approx_shape_functions);
333  this->d2phidxdz.resize (n_approx_shape_functions);
334  this->d2phidy2.resize (n_approx_shape_functions);
335  this->d2phidydz.resize (n_approx_shape_functions);
336  this->d2phidz2.resize (n_approx_shape_functions);
337 
338  if (Dim > 0)
339  this->d2phidxi2.resize (n_approx_shape_functions);
340 
341  if (Dim > 1)
342  {
343  this->d2phidxideta.resize (n_approx_shape_functions);
344  this->d2phideta2.resize (n_approx_shape_functions);
345  }
346  if (Dim > 2)
347  {
348  this->d2phidxidzeta.resize (n_approx_shape_functions);
349  this->d2phidetadzeta.resize (n_approx_shape_functions);
350  this->d2phidzeta2.resize (n_approx_shape_functions);
351  }
352  }
353 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
354 
355  for (unsigned int i=0; i<n_approx_shape_functions; i++)
356  {
357  if (this->calculate_phi)
358  this->phi[i].resize (n_qp);
359  if (this->calculate_dphi)
360  {
361  this->dphi[i].resize (n_qp);
362  this->dphidx[i].resize (n_qp);
363  this->dphidy[i].resize (n_qp);
364  this->dphidz[i].resize (n_qp);
365  }
366 
367  if(this->calculate_dphiref)
368  {
369  if (Dim > 0)
370  this->dphidxi[i].resize(n_qp);
371 
372  if (Dim > 1)
373  this->dphideta[i].resize(n_qp);
374 
375  if (Dim > 2)
376  this->dphidzeta[i].resize(n_qp);
377  }
378 
380  this->curl_phi[i].resize(n_qp);
381 
383  this->div_phi[i].resize(n_qp);
384 
385 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
386  if (this->calculate_d2phi)
387  {
388  this->d2phi[i].resize (n_qp);
389  this->d2phidx2[i].resize (n_qp);
390  this->d2phidxdy[i].resize (n_qp);
391  this->d2phidxdz[i].resize (n_qp);
392  this->d2phidy2[i].resize (n_qp);
393  this->d2phidydz[i].resize (n_qp);
394  this->d2phidz2[i].resize (n_qp);
395  if (Dim > 0)
396  this->d2phidxi2[i].resize (n_qp);
397  if (Dim > 1)
398  {
399  this->d2phidxideta[i].resize (n_qp);
400  this->d2phideta2[i].resize (n_qp);
401  }
402  if (Dim > 2)
403  {
404  this->d2phidxidzeta[i].resize (n_qp);
405  this->d2phidetadzeta[i].resize (n_qp);
406  this->d2phidzeta2[i].resize (n_qp);
407  }
408  }
409 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
410  }
411 
412 
413 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
414  //------------------------------------------------------------
415  // Initialize the data fields, which should only be used for infinite
416  // elements, to some sensible values, so that using a FE with the
417  // variational formulation of an InfFE, correct element matrices are
418  // returned
419 
420  {
421  this->weight.resize (n_qp);
422  this->dweight.resize (n_qp);
423  this->dphase.resize (n_qp);
424 
425  for (unsigned int p=0; p<n_qp; p++)
426  {
427  this->weight[p] = 1.;
428  this->dweight[p].zero();
429  this->dphase[p].zero();
430  }
431 
432  }
433 #endif // ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
434 
435  switch (Dim)
436  {
437 
438  //------------------------------------------------------------
439  // 0D
440  case 0:
441  {
442  break;
443  }
444 
445  //------------------------------------------------------------
446  // 1D
447  case 1:
448  {
449  // Compute the value of the approximation shape function i at quadrature point p
450  if (this->calculate_dphiref)
451  for (unsigned int i=0; i<n_approx_shape_functions; i++)
452  for (unsigned int p=0; p<n_qp; p++)
453  this->dphidxi[i][p] = FE<Dim,T>::shape_deriv (elem, this->fe_type.order, i, 0, qp[p]);
454 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
455  if (this->calculate_d2phi)
456  for (unsigned int i=0; i<n_approx_shape_functions; i++)
457  for (unsigned int p=0; p<n_qp; p++)
458  this->d2phidxi2[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 0, qp[p]);
459 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
460 
461  break;
462  }
463 
464 
465 
466  //------------------------------------------------------------
467  // 2D
468  case 2:
469  {
470  // Compute the value of the approximation shape function i at quadrature point p
471  if (this->calculate_dphiref)
472  for (unsigned int i=0; i<n_approx_shape_functions; i++)
473  for (unsigned int p=0; p<n_qp; p++)
474  {
475  this->dphidxi[i][p] = FE<Dim,T>::shape_deriv (elem, this->fe_type.order, i, 0, qp[p]);
476  this->dphideta[i][p] = FE<Dim,T>::shape_deriv (elem, this->fe_type.order, i, 1, qp[p]);
477  }
478 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
479  if (this->calculate_d2phi)
480  for (unsigned int i=0; i<n_approx_shape_functions; i++)
481  for (unsigned int p=0; p<n_qp; p++)
482  {
483  this->d2phidxi2[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 0, qp[p]);
484  this->d2phidxideta[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 1, qp[p]);
485  this->d2phideta2[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 2, qp[p]);
486  }
487 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
488 
489 
490  break;
491  }
492 
493 
494 
495  //------------------------------------------------------------
496  // 3D
497  case 3:
498  {
499  // Compute the value of the approximation shape function i at quadrature point p
500  if (this->calculate_dphiref)
501  for (unsigned int i=0; i<n_approx_shape_functions; i++)
502  for (unsigned int p=0; p<n_qp; p++)
503  {
504  this->dphidxi[i][p] = FE<Dim,T>::shape_deriv (elem, this->fe_type.order, i, 0, qp[p]);
505  this->dphideta[i][p] = FE<Dim,T>::shape_deriv (elem, this->fe_type.order, i, 1, qp[p]);
506  this->dphidzeta[i][p] = FE<Dim,T>::shape_deriv (elem, this->fe_type.order, i, 2, qp[p]);
507  }
508 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
509  if (this->calculate_d2phi)
510  for (unsigned int i=0; i<n_approx_shape_functions; i++)
511  for (unsigned int p=0; p<n_qp; p++)
512  {
513  this->d2phidxi2[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 0, qp[p]);
514  this->d2phidxideta[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 1, qp[p]);
515  this->d2phideta2[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 2, qp[p]);
516  this->d2phidxidzeta[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 3, qp[p]);
517  this->d2phidetadzeta[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 4, qp[p]);
518  this->d2phidzeta2[i][p] = FE<Dim,T>::shape_second_deriv (elem, this->fe_type.order, i, 5, qp[p]);
519  }
520 #endif // ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
521 
522  break;
523  }
524 
525 
526  default:
527  libmesh_error_msg("Invalid dimension Dim = " << Dim);
528  }
529 }
std::vector< std::vector< OutputTensor > > d2phi
Definition: fe_base.h:564
std::vector< std::vector< OutputShape > > dphidxi
Definition: fe_base.h:531
std::vector< std::vector< OutputShape > > d2phidxdz
Definition: fe_base.h:609
std::vector< std::vector< OutputShape > > dphidzeta
Definition: fe_base.h:541
std::vector< std::vector< OutputShape > > d2phidydz
Definition: fe_base.h:619
std::vector< std::vector< OutputShape > > d2phidxideta
Definition: fe_base.h:574
static FEFieldType field_type(const FEType &fe_type)
Order get_order() const
Definition: fe_abstract.h:419
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
OrderWrapper order
Definition: fe_type.h:200
std::vector< std::vector< OutputShape > > d2phidx2
Definition: fe_base.h:599
std::vector< std::vector< OutputShape > > curl_phi
Definition: fe_base.h:521
std::vector< std::vector< OutputShape > > dphidy
Definition: fe_base.h:551
std::vector< std::vector< OutputShape > > d2phidy2
Definition: fe_base.h:614
std::vector< std::vector< OutputShape > > d2phidetadzeta
Definition: fe_base.h:589
ElemType get_type() const
Definition: fe_abstract.h:403
std::vector< std::vector< OutputShape > > d2phidxidzeta
Definition: fe_base.h:579
std::vector< std::vector< OutputShape > > d2phidxdy
Definition: fe_base.h:604
std::vector< std::vector< OutputShape > > dphidx
Definition: fe_base.h:546
std::vector< std::vector< OutputShape > > phi
Definition: fe_base.h:511
std::vector< std::vector< OutputShape > > d2phideta2
Definition: fe_base.h:584
std::vector< OutputGradient > dphase
Definition: fe_base.h:642
std::vector< std::vector< OutputDivergence > > div_phi
Definition: fe_base.h:526
std::vector< std::vector< OutputGradient > > dphi
Definition: fe_base.h:516
virtual unsigned int n_shape_functions() const libmesh_override
Definition: fe.C:36
std::vector< std::vector< OutputShape > > d2phidz2
Definition: fe_base.h:624
std::vector< std::vector< OutputShape > > d2phidxi2
Definition: fe_base.h:569
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
std::vector< std::vector< OutputShape > > d2phidzeta2
Definition: fe_base.h:594
std::vector< std::vector< OutputShape > > dphidz
Definition: fe_base.h:556
std::vector< std::vector< OutputShape > > dphideta
Definition: fe_base.h:536
template<unsigned int Dim, FEFamily T>
Point libMesh::FE< Dim, T >::inverse_map ( const Elem elem,
const Point p,
const Real  tolerance = TOLERANCE,
const bool  secure = true 
)
static
Returns
the location (on the reference element) of the point p located in physical space. This function requires inverting the (possibly nonlinear) transformation map, so it is not trivial. The optional parameter tolerance defines how close is "good enough." The map inversion iteration computes the sequence $ \{ p_n \} $, and the iteration is terminated when $ \|p - p_n\| < \mbox{\texttt{tolerance}} $

Definition at line 1566 of file fe_map.C.

References libMesh::TypeVector< T >::add(), libMesh::err, libMesh::DofObject::id(), libMesh::libmesh_assert(), libMesh::libmesh_assert_greater(), libMesh::FE< Dim, T >::map(), libMesh::FE< Dim, T >::map_eta(), libMesh::FE< Dim, T >::map_xi(), libMesh::FE< Dim, T >::map_zeta(), libMesh::TypeVector< T >::norm(), libMesh::FEAbstract::on_reference_element(), libMesh::Elem::print_info(), libMesh::Real, and libMesh::Elem::type().

Referenced by libMesh::FEMap::compute_face_map().

1570 {
1571  libmesh_assert(elem);
1572  libmesh_assert_greater_equal (tolerance, 0.);
1573 
1574 
1575  // Start logging the map inversion.
1576  LOG_SCOPE("inverse_map()", "FE");
1577 
1578  // How much did the point on the reference
1579  // element change by in this Newton step?
1580  Real inverse_map_error = 0.;
1581 
1582  // The point on the reference element. This is
1583  // the "initial guess" for Newton's method. The
1584  // centroid seems like a good idea, but computing
1585  // it is a little more intensive than, say taking
1586  // the zero point.
1587  //
1588  // Convergence should be insensitive of this choice
1589  // for "good" elements.
1590  Point p; // the zero point. No computation required
1591 
1592  // The number of iterations in the map inversion process.
1593  unsigned int cnt = 0;
1594 
1595  // The number of iterations after which we give up and declare
1596  // divergence
1597  const unsigned int max_cnt = 10;
1598 
1599  // The distance (in master element space) beyond which we give up
1600  // and declare divergence. This is no longer used...
1601  // Real max_step_length = 4.;
1602 
1603 
1604 
1605  // Newton iteration loop.
1606  do
1607  {
1608  // Where our current iterate \p p maps to.
1609  const Point physical_guess = FE<Dim,T>::map (elem, p);
1610 
1611  // How far our current iterate is from the actual point.
1612  const Point delta = physical_point - physical_guess;
1613 
1614  // Increment in current iterate \p p, will be computed.
1615  Point dp;
1616 
1617 
1618  // The form of the map and how we invert it depends
1619  // on the dimension that we are in.
1620  switch (Dim)
1621  {
1622  // ------------------------------------------------------------------
1623  // 0D map inversion is trivial
1624  case 0:
1625  {
1626  break;
1627  }
1628 
1629  // ------------------------------------------------------------------
1630  // 1D map inversion
1631  //
1632  // Here we find the point on a 1D reference element that maps to
1633  // the point \p physical_point in the domain. This is a bit tricky
1634  // since we do not want to assume that the point \p physical_point
1635  // is also in a 1D domain. In particular, this method might get
1636  // called on the edge of a 3D element, in which case
1637  // \p physical_point actually lives in 3D.
1638  case 1:
1639  {
1640  const Point dxi = FE<Dim,T>::map_xi (elem, p);
1641 
1642  // Newton's method in this case looks like
1643  //
1644  // {X} - {X_n} = [J]*dp
1645  //
1646  // Where {X}, {X_n} are 3x1 vectors, [J] is a 3x1 matrix
1647  // d(x,y,z)/dxi, and we seek dp, a scalar. Since the above
1648  // system is either overdetermined or rank-deficient, we will
1649  // solve the normal equations for this system
1650  //
1651  // [J]^T ({X} - {X_n}) = [J]^T [J] {dp}
1652  //
1653  // which involves the trivial inversion of the scalar
1654  // G = [J]^T [J]
1655  const Real G = dxi*dxi;
1656 
1657  if (secure)
1658  libmesh_assert_greater (G, 0.);
1659 
1660  const Real Ginv = 1./G;
1661 
1662  const Real dxidelta = dxi*delta;
1663 
1664  dp(0) = Ginv*dxidelta;
1665 
1666  // No master elements have radius > 4, but sometimes we
1667  // can take a step that big while still converging
1668  // if (secure)
1669  // libmesh_assert_less (dp.size(), max_step_length);
1670 
1671  break;
1672  }
1673 
1674 
1675 
1676  // ------------------------------------------------------------------
1677  // 2D map inversion
1678  //
1679  // Here we find the point on a 2D reference element that maps to
1680  // the point \p physical_point in the domain. This is a bit tricky
1681  // since we do not want to assume that the point \p physical_point
1682  // is also in a 2D domain. In particular, this method might get
1683  // called on the face of a 3D element, in which case
1684  // \p physical_point actually lives in 3D.
1685  case 2:
1686  {
1687  const Point dxi = FE<Dim,T>::map_xi (elem, p);
1688  const Point deta = FE<Dim,T>::map_eta (elem, p);
1689 
1690  // Newton's method in this case looks like
1691  //
1692  // {X} - {X_n} = [J]*{dp}
1693  //
1694  // Where {X}, {X_n} are 3x1 vectors, [J] is a 3x2 matrix
1695  // d(x,y,z)/d(xi,eta), and we seek {dp}, a 2x1 vector. Since
1696  // the above system is either overdermined or rank-deficient,
1697  // we will solve the normal equations for this system
1698  //
1699  // [J]^T ({X} - {X_n}) = [J]^T [J] {dp}
1700  //
1701  // which involves the inversion of the 2x2 matrix
1702  // [G] = [J]^T [J]
1703  const Real
1704  G11 = dxi*dxi, G12 = dxi*deta,
1705  G21 = dxi*deta, G22 = deta*deta;
1706 
1707 
1708  const Real det = (G11*G22 - G12*G21);
1709 
1710  if (secure)
1711  libmesh_assert_not_equal_to (det, 0.);
1712 
1713  const Real inv_det = 1./det;
1714 
1715  const Real
1716  Ginv11 = G22*inv_det,
1717  Ginv12 = -G12*inv_det,
1718 
1719  Ginv21 = -G21*inv_det,
1720  Ginv22 = G11*inv_det;
1721 
1722 
1723  const Real dxidelta = dxi*delta;
1724  const Real detadelta = deta*delta;
1725 
1726  dp(0) = (Ginv11*dxidelta + Ginv12*detadelta);
1727  dp(1) = (Ginv21*dxidelta + Ginv22*detadelta);
1728 
1729  // No master elements have radius > 4, but sometimes we
1730  // can take a step that big while still converging
1731  // if (secure)
1732  // libmesh_assert_less (dp.size(), max_step_length);
1733 
1734  break;
1735  }
1736 
1737 
1738 
1739  // ------------------------------------------------------------------
1740  // 3D map inversion
1741  //
1742  // Here we find the point in a 3D reference element that maps to
1743  // the point \p physical_point in a 3D domain. Nothing special
1744  // has to happen here, since (unless the map is singular because
1745  // you have a BAD element) the map will be invertable and we can
1746  // apply Newton's method directly.
1747  case 3:
1748  {
1749  const Point dxi = FE<Dim,T>::map_xi (elem, p);
1750  const Point deta = FE<Dim,T>::map_eta (elem, p);
1751  const Point dzeta = FE<Dim,T>::map_zeta (elem, p);
1752 
1753  // Newton's method in this case looks like
1754  //
1755  // {X} = {X_n} + [J]*{dp}
1756  //
1757  // Where {X}, {X_n} are 3x1 vectors, [J] is a 3x3 matrix
1758  // d(x,y,z)/d(xi,eta,zeta), and we seek {dp}, a 3x1 vector.
1759  // Since the above system is nonsingular for invertable maps
1760  // we will solve
1761  //
1762  // {dp} = [J]^-1 ({X} - {X_n})
1763  //
1764  // which involves the inversion of the 3x3 matrix [J]
1765  libmesh_try
1766  {
1767  RealTensorValue(dxi(0), deta(0), dzeta(0),
1768  dxi(1), deta(1), dzeta(1),
1769  dxi(2), deta(2), dzeta(2)).solve(delta, dp);
1770  }
1771  libmesh_catch (ConvergenceFailure &)
1772  {
1773  // We encountered a singular Jacobian. The value of
1774  // dp is zero, since it was never changed during the
1775  // call to RealTensorValue::solve(). We don't want to
1776  // continue iterating until max_cnt since there is no
1777  // update to the Newton iterate, and we don't want to
1778  // print the inverse_map_error value since it will
1779  // confusingly be 0. Therefore, in the secure case we
1780  // need to throw an error message while in the !secure
1781  // case we can just return a far away point.
1782  if (secure)
1783  {
1784  libMesh::err << "ERROR: Newton scheme encountered a singular Jacobian in element: "
1785  << elem->id()
1786  << std::endl;
1787 
1788  elem->print_info(libMesh::err);
1789 
1790  libmesh_error_msg("Exiting...");
1791  }
1792  else
1793  {
1794  for (unsigned int i=0; i != Dim; ++i)
1795  p(i) = 1e6;
1796  return p;
1797  }
1798  }
1799 
1800  // No master elements have radius > 4, but sometimes we
1801  // can take a step that big while still converging
1802  // if (secure)
1803  // libmesh_assert_less (dp.size(), max_step_length);
1804 
1805  break;
1806  }
1807 
1808 
1809  // Some other dimension?
1810  default:
1811  libmesh_error_msg("Invalid Dim = " << Dim);
1812  } // end switch(Dim), dp now computed
1813 
1814 
1815 
1816  // ||P_n+1 - P_n||
1817  inverse_map_error = dp.norm();
1818 
1819  // P_n+1 = P_n + dp
1820  p.add (dp);
1821 
1822  // Increment the iteration count.
1823  cnt++;
1824 
1825  // Watch for divergence of Newton's
1826  // method. Here's how it goes:
1827  // (1) For good elements, we expect convergence in 10
1828  // iterations, with no too-large steps.
1829  // - If called with (secure == true) and we have not yet converged
1830  // print out a warning message.
1831  // - If called with (secure == true) and we have not converged in
1832  // 20 iterations abort
1833  // (2) This method may be called in cases when the target point is not
1834  // inside the element and we have no business expecting convergence.
1835  // For these cases if we have not converged in 10 iterations forget
1836  // about it.
1837  if (cnt > max_cnt)
1838  {
1839  // Warn about divergence when secure is true - this
1840  // shouldn't happen
1841  if (secure)
1842  {
1843  // Print every time in devel/dbg modes
1844 #ifndef NDEBUG
1845  libmesh_here();
1846  libMesh::err << "WARNING: Newton scheme has not converged in "
1847  << cnt << " iterations:" << std::endl
1848  << " physical_point="
1849  << physical_point
1850  << " physical_guess="
1851  << physical_guess
1852  << " dp="
1853  << dp
1854  << " p="
1855  << p
1856  << " error=" << inverse_map_error
1857  << " in element " << elem->id()
1858  << std::endl;
1859 
1860  elem->print_info(libMesh::err);
1861 #else
1862  // In optimized mode, just print once that an inverse_map() call
1863  // had trouble converging its Newton iteration.
1864  libmesh_do_once(libMesh::err << "WARNING: At least one element took more than "
1865  << max_cnt
1866  << " iterations to converge in inverse_map()...\n"
1867  << "Rerun in devel/dbg mode for more details."
1868  << std::endl;);
1869 
1870 #endif // NDEBUG
1871 
1872  if (cnt > 2*max_cnt)
1873  {
1874  libMesh::err << "ERROR: Newton scheme FAILED to converge in "
1875  << cnt
1876  << " iterations in element "
1877  << elem->id()
1878  << " for physical point = "
1879  << physical_point
1880  << std::endl;
1881 
1882  elem->print_info(libMesh::err);
1883 
1884  libmesh_error_msg("Exiting...");
1885  }
1886  }
1887  // Return a far off point when secure is false - this
1888  // should only happen when we're trying to map a point
1889  // that's outside the element
1890  else
1891  {
1892  for (unsigned int i=0; i != Dim; ++i)
1893  p(i) = 1e6;
1894 
1895  return p;
1896  }
1897  }
1898  }
1899  while (inverse_map_error > tolerance);
1900 
1901 
1902 
1903  // If we are in debug mode do two sanity checks.
1904 #ifdef DEBUG
1905 
1906  if (secure)
1907  {
1908  // Make sure the point \p p on the reference element actually
1909  // does map to the point \p physical_point within a tolerance.
1910 
1911  const Point check = FE<Dim,T>::map (elem, p);
1912  const Point diff = physical_point - check;
1913 
1914  if (diff.norm() > tolerance)
1915  {
1916  libmesh_here();
1917  libMesh::err << "WARNING: diff is "
1918  << diff.norm()
1919  << std::endl
1920  << " point="
1921  << physical_point;
1922  libMesh::err << " local=" << check;
1923  libMesh::err << " lref= " << p;
1924 
1925  elem->print_info(libMesh::err);
1926  }
1927 
1928  // Make sure the point \p p on the reference element actually
1929  // is
1930 
1931  if (!FEAbstract::on_reference_element(p, elem->type(), 2*tolerance))
1932  {
1933  libmesh_here();
1934  libMesh::err << "WARNING: inverse_map of physical point "
1935  << physical_point
1936  << " is not on element." << '\n';
1937  elem->print_info(libMesh::err);
1938  }
1939  }
1940 
1941 #endif
1942 
1943  return p;
1944 }
static Point map_zeta(const Elem *elem, const Point &reference_point)
Definition: fe_map.C:2058
libmesh_assert(remote_elem)
static Point map_xi(const Elem *elem, const Point &reference_point)
Definition: fe_map.C:2002
static bool on_reference_element(const Point &p, const ElemType t, const Real eps=TOLERANCE)
Definition: fe_abstract.C:556
TensorValue< Real > RealTensorValue
static Point map(const Elem *elem, const Point &reference_point)
Definition: fe_map.C:1975
OStreamProxy err(std::cerr)
libmesh_assert_greater(libMeshPrivateData::_n_processors, 0)
static Point map_eta(const Elem *elem, const Point &reference_point)
Definition: fe_map.C:2030
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<unsigned int Dim, FEFamily T>
void libMesh::FE< Dim, T >::inverse_map ( const Elem elem,
const std::vector< Point > &  physical_points,
std::vector< Point > &  reference_points,
const Real  tolerance = TOLERANCE,
const bool  secure = true 
)
static

Takes a number points in physical space (in the physical_points vector) and finds their location on the reference element for the input element elem. The values on the reference element are returned in the vector reference_points. The optional parameter tolerance defines how close is "good enough." The map inversion iteration computes the sequence $ \{ p_n \} $, and the iteration is terminated when $ \|p - p_n\| < \mbox{\texttt{tolerance}} $

Definition at line 1950 of file fe_map.C.

References libMesh::TypeVector< T >::size().

1955 {
1956  // The number of points to find the
1957  // inverse map of
1958  const std::size_t n_points = physical_points.size();
1959 
1960  // Resize the vector to hold the points
1961  // on the reference element
1962  reference_points.resize(n_points);
1963 
1964  // Find the coordinates on the reference
1965  // element of each point in physical space
1966  for (std::size_t p=0; p<n_points; p++)
1967  reference_points[p] =
1968  FE<Dim,T>::inverse_map (elem, physical_points[p], tolerance, secure);
1969 }
template<>
Point libMesh::FE< 2, SUBDIVISION >::inverse_map ( const Elem ,
const Point ,
const Real  ,
const bool   
)

Definition at line 894 of file fe_subdivision_2D.C.

898 {
899  libmesh_not_implemented();
900 }
template<>
void libMesh::FE< 2, SUBDIVISION >::inverse_map ( const Elem ,
const std::vector< Point > &  ,
std::vector< Point > &  ,
Real  ,
bool   
)

Definition at line 903 of file fe_subdivision_2D.C.

908 {
909  libmesh_not_implemented();
910 }
template<>
bool libMesh::FE< 0, SCALAR >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 113 of file fe_scalar.C.

113 { return false; }
template<>
bool libMesh::FE< 1, SCALAR >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 114 of file fe_scalar.C.

114 { return false; }
template<>
bool libMesh::FE< 2, SCALAR >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 115 of file fe_scalar.C.

115 { return false; }
template<>
bool libMesh::FE< 3, SCALAR >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 116 of file fe_scalar.C.

116 { return false; }
template<>
bool libMesh::FE< 0, L2_HIERARCHIC >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 200 of file fe_l2_hierarchic.C.

200 { return true; }
template<>
bool libMesh::FE< 1, L2_HIERARCHIC >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 201 of file fe_l2_hierarchic.C.

201 { return true; }
template<>
bool libMesh::FE< 2, L2_HIERARCHIC >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 202 of file fe_l2_hierarchic.C.

202 { return true; }
template<>
bool libMesh::FE< 3, L2_HIERARCHIC >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 203 of file fe_l2_hierarchic.C.

203 { return true; }
template<unsigned int Dim, FEFamily T>
virtual bool libMesh::FE< Dim, T >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

template<>
bool libMesh::FE< 0, CLOUGH >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 305 of file fe_clough.C.

305 { return false; } // FIXME - this will be changed
template<>
bool libMesh::FE< 1, CLOUGH >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 306 of file fe_clough.C.

306 { return false; } // FIXME - this will be changed
template<>
bool libMesh::FE< 2, CLOUGH >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 307 of file fe_clough.C.

307 { return false; } // FIXME - this will be changed
template<>
bool libMesh::FE< 3, CLOUGH >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 308 of file fe_clough.C.

308 { return false; } // FIXME - this will be changed
template<>
bool libMesh::FE< 0, HERMITE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 345 of file fe_hermite.C.

345 { return true; }
template<>
bool libMesh::FE< 1, HERMITE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 346 of file fe_hermite.C.

346 { return true; }
template<>
bool libMesh::FE< 2, HERMITE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 347 of file fe_hermite.C.

347 { return true; }
template<>
bool libMesh::FE< 3, HERMITE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 348 of file fe_hermite.C.

348 { return true; }
template<>
bool libMesh::FE< 0, HIERARCHIC >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 373 of file fe_hierarchic.C.

373 { return true; }
template<>
bool libMesh::FE< 1, HIERARCHIC >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 374 of file fe_hierarchic.C.

374 { return true; }
template<>
bool libMesh::FE< 2, HIERARCHIC >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 375 of file fe_hierarchic.C.

375 { return true; }
template<>
bool libMesh::FE< 3, HIERARCHIC >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 376 of file fe_hierarchic.C.

376 { return true; }
template<>
bool libMesh::FE< 0, MONOMIAL >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 407 of file fe_monomial.C.

407 { return true; }
template<>
bool libMesh::FE< 1, MONOMIAL >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 408 of file fe_monomial.C.

408 { return true; }
template<>
bool libMesh::FE< 2, MONOMIAL >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 409 of file fe_monomial.C.

409 { return true; }
template<>
bool libMesh::FE< 3, MONOMIAL >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 410 of file fe_monomial.C.

410 { return true; }
template<>
bool libMesh::FE< 0, BERNSTEIN >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 436 of file fe_bernstein.C.

436 { return false; }
template<>
bool libMesh::FE< 1, BERNSTEIN >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 437 of file fe_bernstein.C.

437 { return false; }
template<>
bool libMesh::FE< 2, BERNSTEIN >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 438 of file fe_bernstein.C.

438 { return false; }
template<>
bool libMesh::FE< 3, BERNSTEIN >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 439 of file fe_bernstein.C.

439 { return false; }
template<>
bool libMesh::FE< 0, L2_LAGRANGE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 481 of file fe_l2_lagrange.C.

481 { return false; }
template<>
bool libMesh::FE< 1, L2_LAGRANGE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 482 of file fe_l2_lagrange.C.

482 { return false; }
template<>
bool libMesh::FE< 2, L2_LAGRANGE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 483 of file fe_l2_lagrange.C.

483 { return false; }
template<>
bool libMesh::FE< 3, L2_LAGRANGE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 484 of file fe_l2_lagrange.C.

484 { return false; }
template<>
bool libMesh::FE< 0, NEDELEC_ONE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 556 of file fe_nedelec_one.C.

556 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
bool libMesh::FE< 1, NEDELEC_ONE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 557 of file fe_nedelec_one.C.

557 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
bool libMesh::FE< 2, NEDELEC_ONE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 558 of file fe_nedelec_one.C.

558 { return false; }
template<>
bool libMesh::FE< 3, NEDELEC_ONE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 559 of file fe_nedelec_one.C.

559 { return false; }
template<>
bool libMesh::FE< 0, LAGRANGE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 884 of file fe_lagrange.C.

884 { return false; }
template<>
bool libMesh::FE< 1, LAGRANGE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 885 of file fe_lagrange.C.

885 { return false; }
template<>
bool libMesh::FE< 2, LAGRANGE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 886 of file fe_lagrange.C.

886 { return false; }
template<>
bool libMesh::FE< 3, LAGRANGE >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 887 of file fe_lagrange.C.

887 { return false; }
template<>
bool libMesh::FE< 0, XYZ >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 922 of file fe_xyz.C.

922 { return true; }
template<>
bool libMesh::FE< 1, XYZ >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 923 of file fe_xyz.C.

923 { return true; }
template<>
bool libMesh::FE< 2, XYZ >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 924 of file fe_xyz.C.

924 { return true; }
template<>
bool libMesh::FE< 3, XYZ >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 925 of file fe_xyz.C.

925 { return true; }
template<>
bool libMesh::FE< 2, SUBDIVISION >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 931 of file fe_subdivision_2D.C.

931 { return false; }
template<>
bool libMesh::FE< 0, LAGRANGE_VEC >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 933 of file fe_lagrange_vec.C.

933 { return false; }
template<>
bool libMesh::FE< 1, LAGRANGE_VEC >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 934 of file fe_lagrange_vec.C.

934 { return false; }
template<>
bool libMesh::FE< 2, LAGRANGE_VEC >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 935 of file fe_lagrange_vec.C.

935 { return false; }
template<>
bool libMesh::FE< 3, LAGRANGE_VEC >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 936 of file fe_lagrange_vec.C.

936 { return false; }
template<>
bool libMesh::FE< 0, SZABAB >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 1285 of file fe_szabab.C.

1285 { return true; }
template<>
bool libMesh::FE< 1, SZABAB >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 1286 of file fe_szabab.C.

1286 { return true; }
template<>
bool libMesh::FE< 2, SZABAB >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 1287 of file fe_szabab.C.

1287 { return true; }
template<>
bool libMesh::FE< 3, SZABAB >::is_hierarchic ( ) const
virtual
Returns
true if the finite element's higher order shape functions are hierarchic

Implements libMesh::FEAbstract.

Definition at line 1288 of file fe_szabab.C.

1288 { return true; }
template<unsigned int Dim, FEFamily T>
Point libMesh::FE< Dim, T >::map ( const Elem elem,
const Point reference_point 
)
static
Returns
the location (in physical space) of the point p located on the reference element.

Definition at line 1975 of file fe_map.C.

References libMesh::TypeVector< T >::add_scaled(), libMesh::Elem::default_order(), libMesh::libmesh_assert(), libMesh::FE< Dim, T >::n_shape_functions(), libMesh::Elem::point(), libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

Referenced by libMesh::FE< Dim, T >::inverse_map(), libMesh::InfFE< Dim, T_radial, T_map >::inverse_map(), and libMesh::InfFE< Dim, T_radial, T_map >::map().

1977 {
1978  libmesh_assert(elem);
1979 
1980  Point p;
1981 
1982  const ElemType type = elem->type();
1983  const Order order = elem->default_order();
1984  const unsigned int n_sf = FE<Dim,LAGRANGE>::n_shape_functions(type, order);
1985 
1986  // Lagrange basis functions are used for mapping
1987  for (unsigned int i=0; i<n_sf; i++)
1988  p.add_scaled (elem->point(i),
1990  order,
1991  i,
1992  reference_point)
1993  );
1994 
1995  return p;
1996 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
virtual unsigned int n_shape_functions() const libmesh_override
Definition: fe.C:36
template<unsigned int Dim, FEFamily T>
Point libMesh::FE< Dim, T >::map_eta ( const Elem elem,
const Point reference_point 
)
static
Returns
d(xyz)/deta (in physical space) of the point p located on the reference element.

Definition at line 2030 of file fe_map.C.

References libMesh::TypeVector< T >::add_scaled(), libMesh::Elem::default_order(), libMesh::libmesh_assert(), libMesh::FE< Dim, T >::n_shape_functions(), libMesh::Elem::point(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

Referenced by libMesh::FEMap::compute_face_map(), libMesh::FE< Dim, T >::inverse_map(), and libMesh::InfFE< Dim, T_radial, T_map >::inverse_map().

2032 {
2033  libmesh_assert(elem);
2034 
2035  Point p;
2036 
2037  const ElemType type = elem->type();
2038  const Order order = elem->default_order();
2039  const unsigned int n_sf = FE<Dim,LAGRANGE>::n_shape_functions(type, order);
2040 
2041  // Lagrange basis functions are used for mapping
2042  for (unsigned int i=0; i<n_sf; i++)
2043  p.add_scaled (elem->point(i),
2045  order,
2046  i,
2047  1,
2048  reference_point)
2049  );
2050 
2051  return p;
2052 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
virtual unsigned int n_shape_functions() const libmesh_override
Definition: fe.C:36
template<unsigned int Dim, FEFamily T>
Point libMesh::FE< Dim, T >::map_xi ( const Elem elem,
const Point reference_point 
)
static
Returns
d(xyz)/dxi (in physical space) of the point p located on the reference element.

Definition at line 2002 of file fe_map.C.

References libMesh::TypeVector< T >::add_scaled(), libMesh::Elem::default_order(), libMesh::libmesh_assert(), libMesh::FE< Dim, T >::n_shape_functions(), libMesh::Elem::point(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

Referenced by libMesh::FEMap::compute_face_map(), libMesh::FE< Dim, T >::inverse_map(), and libMesh::InfFE< Dim, T_radial, T_map >::inverse_map().

2004 {
2005  libmesh_assert(elem);
2006 
2007  Point p;
2008 
2009  const ElemType type = elem->type();
2010  const Order order = elem->default_order();
2011  const unsigned int n_sf = FE<Dim,LAGRANGE>::n_shape_functions(type, order);
2012 
2013  // Lagrange basis functions are used for mapping
2014  for (unsigned int i=0; i<n_sf; i++)
2015  p.add_scaled (elem->point(i),
2017  order,
2018  i,
2019  0,
2020  reference_point)
2021  );
2022 
2023  return p;
2024 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
virtual unsigned int n_shape_functions() const libmesh_override
Definition: fe.C:36
template<unsigned int Dim, FEFamily T>
Point libMesh::FE< Dim, T >::map_zeta ( const Elem elem,
const Point reference_point 
)
static
Returns
d(xyz)/dzeta (in physical space) of the point p located on the reference element.

Definition at line 2058 of file fe_map.C.

References libMesh::TypeVector< T >::add_scaled(), libMesh::Elem::default_order(), libMesh::libmesh_assert(), libMesh::FE< Dim, T >::n_shape_functions(), libMesh::Elem::point(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

Referenced by libMesh::FE< Dim, T >::inverse_map().

2060 {
2061  libmesh_assert(elem);
2062 
2063  Point p;
2064 
2065  const ElemType type = elem->type();
2066  const Order order = elem->default_order();
2067  const unsigned int n_sf = FE<Dim,LAGRANGE>::n_shape_functions(type, order);
2068 
2069  // Lagrange basis functions are used for mapping
2070  for (unsigned int i=0; i<n_sf; i++)
2071  p.add_scaled (elem->point(i),
2073  order,
2074  i,
2075  2,
2076  reference_point)
2077  );
2078 
2079  return p;
2080 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
virtual unsigned int n_shape_functions() const libmesh_override
Definition: fe.C:36
template<>
unsigned int libMesh::FE< 0, SCALAR >::n_dofs ( const ElemType  ,
const Order  o 
)

Definition at line 87 of file fe_scalar.C.

87 { return o; }
template<>
unsigned int libMesh::FE< 1, SCALAR >::n_dofs ( const ElemType  ,
const Order  o 
)

Definition at line 88 of file fe_scalar.C.

88 { return o; }
template<>
unsigned int libMesh::FE< 2, SCALAR >::n_dofs ( const ElemType  ,
const Order  o 
)

Definition at line 89 of file fe_scalar.C.

89 { return o; }
template<>
unsigned int libMesh::FE< 3, SCALAR >::n_dofs ( const ElemType  ,
const Order  o 
)

Definition at line 90 of file fe_scalar.C.

90 { return o; }
template<>
unsigned int libMesh::FE< 0, L2_HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 175 of file fe_l2_hierarchic.C.

175 { return l2_hierarchic_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 1, L2_HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 176 of file fe_l2_hierarchic.C.

176 { return l2_hierarchic_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 2, L2_HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 177 of file fe_l2_hierarchic.C.

177 { return l2_hierarchic_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 3, L2_HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 178 of file fe_l2_hierarchic.C.

178 { return l2_hierarchic_n_dofs(t, o); }
template<unsigned int Dim, FEFamily T>
static unsigned int libMesh::FE< Dim, T >::n_dofs ( const ElemType  t,
const Order  o 
)
static
Returns
the number of shape functions associated with this finite element.

On a p-refined element, o should be the total order of the element.

Referenced by libMesh::FE< Dim, T >::n_dofs(), libMesh::FE< Dim, T >::n_shape_functions(), and libMesh::FE< Dim, LAGRANGE_VEC >::n_shape_functions().

template<>
unsigned int libMesh::FE< 0, CLOUGH >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 280 of file fe_clough.C.

280 { return clough_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 1, CLOUGH >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 281 of file fe_clough.C.

281 { return clough_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 2, CLOUGH >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 282 of file fe_clough.C.

282 { return clough_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 3, CLOUGH >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 283 of file fe_clough.C.

283 { return clough_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 0, HERMITE >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 320 of file fe_hermite.C.

320 { return hermite_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 1, HERMITE >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 321 of file fe_hermite.C.

321 { return hermite_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 2, HERMITE >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 322 of file fe_hermite.C.

322 { return hermite_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 3, HERMITE >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 323 of file fe_hermite.C.

323 { return hermite_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 0, HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 349 of file fe_hierarchic.C.

349 { return hierarchic_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 1, HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 350 of file fe_hierarchic.C.

350 { return hierarchic_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 2, HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 351 of file fe_hierarchic.C.

351 { return hierarchic_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 3, HIERARCHIC >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 352 of file fe_hierarchic.C.

352 { return hierarchic_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 0, MONOMIAL >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 380 of file fe_monomial.C.

380 { return monomial_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 1, MONOMIAL >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 381 of file fe_monomial.C.

381 { return monomial_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 2, MONOMIAL >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 382 of file fe_monomial.C.

382 { return monomial_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 3, MONOMIAL >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 383 of file fe_monomial.C.

383 { return monomial_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 0, BERNSTEIN >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 412 of file fe_bernstein.C.

412 { return bernstein_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 1, BERNSTEIN >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 413 of file fe_bernstein.C.

413 { return bernstein_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 2, BERNSTEIN >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 414 of file fe_bernstein.C.

414 { return bernstein_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 3, BERNSTEIN >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 415 of file fe_bernstein.C.

415 { return bernstein_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 0, L2_LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 455 of file fe_l2_lagrange.C.

455 { return l2_lagrange_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 1, L2_LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 456 of file fe_l2_lagrange.C.

456 { return l2_lagrange_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 2, L2_LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 457 of file fe_l2_lagrange.C.

457 { return l2_lagrange_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 3, L2_LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 458 of file fe_l2_lagrange.C.

458 { return l2_lagrange_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 0, NEDELEC_ONE >::n_dofs ( const ElemType  ,
const Order   
)

Definition at line 528 of file fe_nedelec_one.C.

528 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
unsigned int libMesh::FE< 1, NEDELEC_ONE >::n_dofs ( const ElemType  ,
const Order   
)

Definition at line 529 of file fe_nedelec_one.C.

529 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
unsigned int libMesh::FE< 2, NEDELEC_ONE >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 530 of file fe_nedelec_one.C.

530 { return nedelec_one_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 3, NEDELEC_ONE >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 531 of file fe_nedelec_one.C.

531 { return nedelec_one_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 0, LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 856 of file fe_lagrange.C.

856 { return lagrange_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 1, LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 857 of file fe_lagrange.C.

857 { return lagrange_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 2, LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 858 of file fe_lagrange.C.

858 { return lagrange_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 3, LAGRANGE >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 859 of file fe_lagrange.C.

859 { return lagrange_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 0, XYZ >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 896 of file fe_xyz.C.

896 { return xyz_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 1, XYZ >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 897 of file fe_xyz.C.

897 { return xyz_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 2, XYZ >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 898 of file fe_xyz.C.

898 { return xyz_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 3, XYZ >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 899 of file fe_xyz.C.

899 { return xyz_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 0, LAGRANGE_VEC >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 905 of file fe_lagrange_vec.C.

References libMesh::FE< Dim, T >::n_dofs().

905 { return FE<0,LAGRANGE>::n_dofs(t,o); }
static unsigned int n_dofs(const ElemType t, const Order o)
template<>
unsigned int libMesh::FE< 1, LAGRANGE_VEC >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 906 of file fe_lagrange_vec.C.

References libMesh::FE< Dim, T >::n_dofs().

906 { return FE<1,LAGRANGE>::n_dofs(t,o); }
static unsigned int n_dofs(const ElemType t, const Order o)
template<>
unsigned int libMesh::FE< 2, LAGRANGE_VEC >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 907 of file fe_lagrange_vec.C.

References libMesh::FE< Dim, T >::n_dofs().

907 { return 2*FE<2,LAGRANGE>::n_dofs(t,o); }
static unsigned int n_dofs(const ElemType t, const Order o)
template<>
unsigned int libMesh::FE< 3, LAGRANGE_VEC >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 908 of file fe_lagrange_vec.C.

References libMesh::FE< Dim, T >::n_dofs().

908 { return 3*FE<3,LAGRANGE>::n_dofs(t,o); }
static unsigned int n_dofs(const ElemType t, const Order o)
template<>
unsigned int libMesh::FE< 2, SUBDIVISION >::n_dofs ( const ElemType  ,
const Order   
)

Definition at line 915 of file fe_subdivision_2D.C.

915 { libmesh_not_implemented(); return 0; }
template<>
unsigned int libMesh::FE< 0, SZABAB >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 1261 of file fe_szabab.C.

1261 { return szabab_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 1, SZABAB >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 1262 of file fe_szabab.C.

1262 { return szabab_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 2, SZABAB >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 1263 of file fe_szabab.C.

1263 { return szabab_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 3, SZABAB >::n_dofs ( const ElemType  t,
const Order  o 
)

Definition at line 1264 of file fe_szabab.C.

1264 { return szabab_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 0, SCALAR >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 94 of file fe_scalar.C.

94 { return 0; }
template<>
unsigned int libMesh::FE< 1, SCALAR >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 95 of file fe_scalar.C.

95 { return 0; }
template<>
unsigned int libMesh::FE< 2, SCALAR >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 96 of file fe_scalar.C.

96 { return 0; }
template<>
unsigned int libMesh::FE< 3, SCALAR >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 97 of file fe_scalar.C.

97 { return 0; }
template<>
unsigned int libMesh::FE< 0, L2_HIERARCHIC >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 182 of file fe_l2_hierarchic.C.

182 { return 0; }
template<>
unsigned int libMesh::FE< 1, L2_HIERARCHIC >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 183 of file fe_l2_hierarchic.C.

183 { return 0; }
template<>
unsigned int libMesh::FE< 2, L2_HIERARCHIC >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 184 of file fe_l2_hierarchic.C.

184 { return 0; }
template<>
unsigned int libMesh::FE< 3, L2_HIERARCHIC >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 185 of file fe_l2_hierarchic.C.

185 { return 0; }
template<unsigned int Dim, FEFamily T>
static unsigned int libMesh::FE< Dim, T >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)
static
Returns
the number of dofs at node n for a finite element of type t and order o.

On a p-refined element, o should be the total order of the element.

Referenced by libMesh::FE< Dim, T >::n_dofs_at_node().

template<>
unsigned int libMesh::FE< 0, CLOUGH >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 287 of file fe_clough.C.

287 { return clough_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 1, CLOUGH >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 288 of file fe_clough.C.

288 { return clough_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 2, CLOUGH >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 289 of file fe_clough.C.

289 { return clough_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 3, CLOUGH >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 290 of file fe_clough.C.

290 { return clough_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 0, HERMITE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 327 of file fe_hermite.C.

327 { return hermite_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 1, HERMITE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 328 of file fe_hermite.C.

328 { return hermite_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 2, HERMITE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 329 of file fe_hermite.C.

329 { return hermite_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 3, HERMITE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 330 of file fe_hermite.C.

330 { return hermite_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 0, HIERARCHIC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 355 of file fe_hierarchic.C.

355 { return hierarchic_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 1, HIERARCHIC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 356 of file fe_hierarchic.C.

356 { return hierarchic_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 2, HIERARCHIC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 357 of file fe_hierarchic.C.

357 { return hierarchic_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 3, HIERARCHIC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 358 of file fe_hierarchic.C.

358 { return hierarchic_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 0, MONOMIAL >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 387 of file fe_monomial.C.

387 { return 0; }
template<>
unsigned int libMesh::FE< 1, MONOMIAL >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 388 of file fe_monomial.C.

388 { return 0; }
template<>
unsigned int libMesh::FE< 2, MONOMIAL >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 389 of file fe_monomial.C.

389 { return 0; }
template<>
unsigned int libMesh::FE< 3, MONOMIAL >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 390 of file fe_monomial.C.

390 { return 0; }
template<>
unsigned int libMesh::FE< 0, BERNSTEIN >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 418 of file fe_bernstein.C.

418 { return bernstein_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 1, BERNSTEIN >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 419 of file fe_bernstein.C.

419 { return bernstein_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 2, BERNSTEIN >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 420 of file fe_bernstein.C.

420 { return bernstein_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 3, BERNSTEIN >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 421 of file fe_bernstein.C.

421 { return bernstein_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 0, L2_LAGRANGE >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 462 of file fe_l2_lagrange.C.

462 { return 0; }
template<>
unsigned int libMesh::FE< 1, L2_LAGRANGE >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 463 of file fe_l2_lagrange.C.

463 { return 0; }
template<>
unsigned int libMesh::FE< 2, L2_LAGRANGE >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 464 of file fe_l2_lagrange.C.

464 { return 0; }
template<>
unsigned int libMesh::FE< 3, L2_LAGRANGE >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 465 of file fe_l2_lagrange.C.

465 { return 0; }
template<>
unsigned int libMesh::FE< 0, NEDELEC_ONE >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 536 of file fe_nedelec_one.C.

536 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
unsigned int libMesh::FE< 1, NEDELEC_ONE >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 537 of file fe_nedelec_one.C.

537 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
unsigned int libMesh::FE< 2, NEDELEC_ONE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 538 of file fe_nedelec_one.C.

538 { return nedelec_one_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 3, NEDELEC_ONE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 539 of file fe_nedelec_one.C.

539 { return nedelec_one_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 0, LAGRANGE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 864 of file fe_lagrange.C.

864 { return lagrange_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 1, LAGRANGE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 865 of file fe_lagrange.C.

865 { return lagrange_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 2, LAGRANGE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 866 of file fe_lagrange.C.

866 { return lagrange_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 3, LAGRANGE >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 867 of file fe_lagrange.C.

867 { return lagrange_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 0, XYZ >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 903 of file fe_xyz.C.

903 { return 0; }
template<>
unsigned int libMesh::FE< 1, XYZ >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 904 of file fe_xyz.C.

904 { return 0; }
template<>
unsigned int libMesh::FE< 2, XYZ >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 905 of file fe_xyz.C.

905 { return 0; }
template<>
unsigned int libMesh::FE< 3, XYZ >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 906 of file fe_xyz.C.

906 { return 0; }
template<>
unsigned int libMesh::FE< 0, LAGRANGE_VEC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 913 of file fe_lagrange_vec.C.

References libMesh::FE< Dim, T >::n_dofs_at_node().

913 { return FE<0,LAGRANGE>::n_dofs_at_node(t,o,n); }
static unsigned int n_dofs_at_node(const ElemType t, const Order o, const unsigned int n)
template<>
unsigned int libMesh::FE< 1, LAGRANGE_VEC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 914 of file fe_lagrange_vec.C.

References libMesh::FE< Dim, T >::n_dofs_at_node().

914 { return FE<1,LAGRANGE>::n_dofs_at_node(t,o,n); }
static unsigned int n_dofs_at_node(const ElemType t, const Order o, const unsigned int n)
template<>
unsigned int libMesh::FE< 2, LAGRANGE_VEC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 915 of file fe_lagrange_vec.C.

References libMesh::FE< Dim, T >::n_dofs_at_node().

915 { return 2*FE<2,LAGRANGE>::n_dofs_at_node(t,o,n); }
static unsigned int n_dofs_at_node(const ElemType t, const Order o, const unsigned int n)
template<>
unsigned int libMesh::FE< 3, LAGRANGE_VEC >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 916 of file fe_lagrange_vec.C.

References libMesh::FE< Dim, T >::n_dofs_at_node().

916 { return 3*FE<2,LAGRANGE>::n_dofs_at_node(t,o,n); }
static unsigned int n_dofs_at_node(const ElemType t, const Order o, const unsigned int n)
template<>
unsigned int libMesh::FE< 2, SUBDIVISION >::n_dofs_at_node ( const ElemType  ,
const Order  ,
const unsigned  int 
)

Definition at line 918 of file fe_subdivision_2D.C.

918 { return 1; }
template<>
unsigned int libMesh::FE< 0, SZABAB >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 1267 of file fe_szabab.C.

1267 { return szabab_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 1, SZABAB >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 1268 of file fe_szabab.C.

1268 { return szabab_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 2, SZABAB >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 1269 of file fe_szabab.C.

1269 { return szabab_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 3, SZABAB >::n_dofs_at_node ( const ElemType  t,
const Order  o,
const unsigned int  n 
)

Definition at line 1270 of file fe_szabab.C.

1270 { return szabab_n_dofs_at_node(t, o, n); }
template<>
unsigned int libMesh::FE< 0, SCALAR >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 101 of file fe_scalar.C.

101 { return 0; }
template<>
unsigned int libMesh::FE< 1, SCALAR >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 102 of file fe_scalar.C.

102 { return 0; }
template<>
unsigned int libMesh::FE< 2, SCALAR >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 103 of file fe_scalar.C.

103 { return 0; }
template<>
unsigned int libMesh::FE< 3, SCALAR >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 104 of file fe_scalar.C.

104 { return 0; }
template<>
unsigned int libMesh::FE< 0, L2_HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 188 of file fe_l2_hierarchic.C.

188 { return l2_hierarchic_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 1, L2_HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 189 of file fe_l2_hierarchic.C.

189 { return l2_hierarchic_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 2, L2_HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 190 of file fe_l2_hierarchic.C.

190 { return l2_hierarchic_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 3, L2_HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 191 of file fe_l2_hierarchic.C.

191 { return l2_hierarchic_n_dofs(t, o); }
template<unsigned int Dim, FEFamily T>
static unsigned int libMesh::FE< Dim, T >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)
static
Returns
the number of dofs interior to the element, not associated with any interior nodes.

On a p-refined element, o should be the total order of the element.

template<>
unsigned int libMesh::FE< 0, CLOUGH >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 293 of file fe_clough.C.

293 { return clough_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 1, CLOUGH >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 294 of file fe_clough.C.

294 { return clough_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 2, CLOUGH >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 295 of file fe_clough.C.

295 { return clough_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 3, CLOUGH >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 296 of file fe_clough.C.

296 { return clough_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 0, HERMITE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 333 of file fe_hermite.C.

333 { return hermite_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 1, HERMITE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 334 of file fe_hermite.C.

334 { return hermite_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 2, HERMITE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 335 of file fe_hermite.C.

335 { return hermite_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 3, HERMITE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 336 of file fe_hermite.C.

336 { return hermite_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 0, HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 361 of file fe_hierarchic.C.

361 { return hierarchic_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 1, HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 362 of file fe_hierarchic.C.

362 { return hierarchic_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 2, HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 363 of file fe_hierarchic.C.

363 { return hierarchic_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 3, HIERARCHIC >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 364 of file fe_hierarchic.C.

364 { return hierarchic_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 0, MONOMIAL >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 393 of file fe_monomial.C.

393 { return monomial_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 1, MONOMIAL >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 394 of file fe_monomial.C.

394 { return monomial_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 2, MONOMIAL >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 395 of file fe_monomial.C.

395 { return monomial_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 3, MONOMIAL >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 396 of file fe_monomial.C.

396 { return monomial_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 0, BERNSTEIN >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 424 of file fe_bernstein.C.

424 { return bernstein_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 1, BERNSTEIN >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 425 of file fe_bernstein.C.

425 { return bernstein_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 2, BERNSTEIN >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 426 of file fe_bernstein.C.

426 { return bernstein_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 3, BERNSTEIN >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 427 of file fe_bernstein.C.

427 { return bernstein_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 0, L2_LAGRANGE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 469 of file fe_l2_lagrange.C.

469 { return l2_lagrange_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 1, L2_LAGRANGE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 470 of file fe_l2_lagrange.C.

470 { return l2_lagrange_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 2, L2_LAGRANGE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 471 of file fe_l2_lagrange.C.

471 { return l2_lagrange_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 3, L2_LAGRANGE >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 472 of file fe_l2_lagrange.C.

472 { return l2_lagrange_n_dofs(t, o); }
template<>
unsigned int libMesh::FE< 0, NEDELEC_ONE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 544 of file fe_nedelec_one.C.

544 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
unsigned int libMesh::FE< 1, NEDELEC_ONE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 545 of file fe_nedelec_one.C.

545 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
unsigned int libMesh::FE< 2, NEDELEC_ONE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 546 of file fe_nedelec_one.C.

546 { return 0; }
template<>
unsigned int libMesh::FE< 3, NEDELEC_ONE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 547 of file fe_nedelec_one.C.

547 { return 0; }
template<>
unsigned int libMesh::FE< 0, LAGRANGE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 872 of file fe_lagrange.C.

872 { return 0; }
template<>
unsigned int libMesh::FE< 1, LAGRANGE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 873 of file fe_lagrange.C.

873 { return 0; }
template<>
unsigned int libMesh::FE< 2, LAGRANGE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 874 of file fe_lagrange.C.

874 { return 0; }
template<>
unsigned int libMesh::FE< 3, LAGRANGE >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 875 of file fe_lagrange.C.

875 { return 0; }
template<>
unsigned int libMesh::FE< 0, XYZ >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 909 of file fe_xyz.C.

909 { return xyz_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 1, XYZ >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 910 of file fe_xyz.C.

910 { return xyz_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 2, XYZ >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 911 of file fe_xyz.C.

911 { return xyz_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 3, XYZ >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 912 of file fe_xyz.C.

912 { return xyz_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 2, SUBDIVISION >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 921 of file fe_subdivision_2D.C.

921 { return 0; }
template<>
unsigned int libMesh::FE< 0, LAGRANGE_VEC >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 921 of file fe_lagrange_vec.C.

921 { return 0; }
template<>
unsigned int libMesh::FE< 1, LAGRANGE_VEC >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 922 of file fe_lagrange_vec.C.

922 { return 0; }
template<>
unsigned int libMesh::FE< 2, LAGRANGE_VEC >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 923 of file fe_lagrange_vec.C.

923 { return 0; }
template<>
unsigned int libMesh::FE< 3, LAGRANGE_VEC >::n_dofs_per_elem ( const ElemType  ,
const Order   
)

Definition at line 924 of file fe_lagrange_vec.C.

924 { return 0; }
template<>
unsigned int libMesh::FE< 0, SZABAB >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 1273 of file fe_szabab.C.

1273 { return szabab_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 1, SZABAB >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 1274 of file fe_szabab.C.

1274 { return szabab_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 2, SZABAB >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 1275 of file fe_szabab.C.

1275 { return szabab_n_dofs_per_elem(t, o); }
template<>
unsigned int libMesh::FE< 3, SZABAB >::n_dofs_per_elem ( const ElemType  t,
const Order  o 
)

Definition at line 1276 of file fe_szabab.C.

1276 { return szabab_n_dofs_per_elem(t, o); }
static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited

Prints the number of outstanding (created, but not yet destroyed) objects.

Definition at line 76 of file reference_counter.h.

References libMesh::ReferenceCounter::_n_objects.

77  { return _n_objects; }
static Threads::atomic< unsigned int > _n_objects
template<unsigned int Dim, FEFamily T>
unsigned int libMesh::FE< Dim, T >::n_quadrature_points ( ) const
virtual
Returns
the total number of quadrature points. Call this to get an upper bound for the for loop in your simulation for matrix assembly of the current element.

Implements libMesh::FEAbstract.

Definition at line 55 of file fe.C.

References libMesh::libmesh_assert().

56 {
57  libmesh_assert(this->qrule);
58  return this->qrule->n_points();
59 }
libmesh_assert(remote_elem)
unsigned int n_points() const
Definition: quadrature.h:116
template<unsigned int Dim, FEFamily T>
unsigned int libMesh::FE< Dim, T >::n_shape_functions ( ) const
virtual
Returns
the number of shape functions associated with this finite element.

Implements libMesh::FEAbstract.

Definition at line 36 of file fe.C.

References libMesh::FE< Dim, T >::n_dofs().

Referenced by libMesh::FEMap::compute_face_map(), libMesh::FEMap::init_edge_shape_functions(), libMesh::FEMap::init_face_shape_functions(), libMesh::FEMap::init_reference_to_physical_map(), libMesh::FE< Dim, T >::map(), libMesh::FE< Dim, T >::map_eta(), libMesh::FE< Dim, T >::map_xi(), libMesh::FE< Dim, T >::map_zeta(), and libMesh::InfFE< Dim, T_radial, T_map >::Base::n_base_mapping_sf().

37 {
38  return FE<Dim,T>::n_dofs (this->elem_type,
39  static_cast<Order>(this->fe_type.order + this->_p_level));
40 }
static unsigned int n_dofs(const ElemType t, const Order o)
OrderWrapper order
Definition: fe_type.h:200
template<unsigned int Dim, FEFamily T>
static unsigned int libMesh::FE< Dim, T >::n_shape_functions ( const ElemType  t,
const Order  o 
)
inlinestatic
Returns
the number of shape functions associated with a finite element of type t and approximation order o.

On a p-refined element, o should be the total order of the element.

Definition at line 224 of file fe.h.

226  { return FE<Dim,T>::n_dofs (t,o); }
static unsigned int n_dofs(const ElemType t, const Order o)
template<>
void libMesh::FE< 0, SCALAR >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 58 of file fe_scalar.C.

62 { scalar_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 1, SCALAR >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 65 of file fe_scalar.C.

69 { scalar_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 2, SCALAR >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 72 of file fe_scalar.C.

76 { scalar_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 3, SCALAR >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 79 of file fe_scalar.C.

83 { scalar_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 0, L2_HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 147 of file fe_l2_hierarchic.C.

151 { l2_hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 1, L2_HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 154 of file fe_l2_hierarchic.C.

158 { l2_hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 2, L2_HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 161 of file fe_l2_hierarchic.C.

165 { l2_hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 3, L2_HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 168 of file fe_l2_hierarchic.C.

172 { l2_hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<unsigned int Dim, FEFamily T>
static void libMesh::FE< Dim, T >::nodal_soln ( const Elem elem,
const Order  o,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)
static

Build the nodal soln from the element soln. This is the solution that will be plotted.

On a p-refined element, o should be the base order of the element.

Referenced by libMesh::FE< Dim, T >::nodal_soln().

template<>
void libMesh::FE< 0, CLOUGH >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 251 of file fe_clough.C.

255 { clough_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 1, CLOUGH >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 258 of file fe_clough.C.

262 { clough_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 2, CLOUGH >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 265 of file fe_clough.C.

269 { clough_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 3, CLOUGH >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 272 of file fe_clough.C.

276 { clough_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 0, HERMITE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 287 of file fe_hermite.C.

291 { hermite_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 1, HERMITE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 294 of file fe_hermite.C.

298 { hermite_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 2, HERMITE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 301 of file fe_hermite.C.

305 { hermite_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 3, HERMITE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 308 of file fe_hermite.C.

312 { hermite_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 0, HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 320 of file fe_hierarchic.C.

324 { hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 1, HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 327 of file fe_hierarchic.C.

331 { hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 2, HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 334 of file fe_hierarchic.C.

338 { hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 3, HIERARCHIC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 341 of file fe_hierarchic.C.

345 { hierarchic_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 0, MONOMIAL >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 351 of file fe_monomial.C.

355 { monomial_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 1, MONOMIAL >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 358 of file fe_monomial.C.

362 { monomial_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 2, MONOMIAL >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 365 of file fe_monomial.C.

369 { monomial_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 3, MONOMIAL >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 372 of file fe_monomial.C.

376 { monomial_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 0, BERNSTEIN >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 383 of file fe_bernstein.C.

387 { bernstein_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 1, BERNSTEIN >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 390 of file fe_bernstein.C.

394 { bernstein_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 2, BERNSTEIN >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 397 of file fe_bernstein.C.

401 { bernstein_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 3, BERNSTEIN >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 404 of file fe_bernstein.C.

408 { bernstein_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 0, L2_LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 424 of file fe_l2_lagrange.C.

428 { l2_lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 1, L2_LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 431 of file fe_l2_lagrange.C.

435 { l2_lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 2, L2_LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 438 of file fe_l2_lagrange.C.

442 { l2_lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 3, L2_LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 445 of file fe_l2_lagrange.C.

449 { l2_lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 0, NEDELEC_ONE >::nodal_soln ( const Elem ,
const Order  ,
const std::vector< Number > &  ,
std::vector< Number > &   
)

Definition at line 497 of file fe_nedelec_one.C.

501 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
void libMesh::FE< 1, NEDELEC_ONE >::nodal_soln ( const Elem ,
const Order  ,
const std::vector< Number > &  ,
std::vector< Number > &   
)

Definition at line 504 of file fe_nedelec_one.C.

508 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
void libMesh::FE< 0, LAGRANGE_VEC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 507 of file fe_lagrange_vec.C.

References libMesh::FE< Dim, T >::nodal_soln().

511 { FE<0,LAGRANGE>::nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 2, NEDELEC_ONE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 511 of file fe_nedelec_one.C.

515 { nedelec_one_nodal_soln(elem, order, elem_soln, 2 /*dim*/, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 1, LAGRANGE_VEC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 514 of file fe_lagrange_vec.C.

References libMesh::FE< Dim, T >::nodal_soln().

518 { FE<1,LAGRANGE>::nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 3, NEDELEC_ONE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 518 of file fe_nedelec_one.C.

522 { nedelec_one_nodal_soln(elem, order, elem_soln, 3 /*dim*/, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 2, LAGRANGE_VEC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 521 of file fe_lagrange_vec.C.

525 { lagrange_vec_nodal_soln(elem, order, elem_soln, 2 /*dimension*/, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 3, LAGRANGE_VEC >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 528 of file fe_lagrange_vec.C.

532 { lagrange_vec_nodal_soln(elem, order, elem_soln, 3 /*dimension*/, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 0, LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 825 of file fe_lagrange.C.

829 { lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 1, LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 832 of file fe_lagrange.C.

836 { lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 2, SUBDIVISION >::nodal_soln ( const Elem elem,
const Order  ,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 836 of file fe_subdivision_2D.C.

References libMesh::libmesh_assert(), libMesh::Tri3Subdivision::local_node_number(), libMesh::TRI3SUBDIVISION, and libMesh::Elem::type().

840 {
841  libmesh_assert(elem);
842  libmesh_assert_equal_to(elem->type(), TRI3SUBDIVISION);
843  const Tri3Subdivision * sd_elem = static_cast<const Tri3Subdivision *>(elem);
844 
845  nodal_soln.resize(3); // three nodes per element
846 
847  // Ghost nodes are auxiliary.
848  if (sd_elem->is_ghost())
849  {
850  nodal_soln[0] = 0;
851  nodal_soln[1] = 0;
852  nodal_soln[2] = 0;
853  return;
854  }
855 
856  // First node (node 0 in the element patch):
857  unsigned int j = sd_elem->local_node_number(sd_elem->get_ordered_node(0)->id());
858  nodal_soln[j] = elem_soln[0];
859 
860  // Second node (node 1 in the element patch):
861  j = sd_elem->local_node_number(sd_elem->get_ordered_node(1)->id());
862  nodal_soln[j] = elem_soln[1];
863 
864  // Third node (node 'valence' in the element patch):
865  j = sd_elem->local_node_number(sd_elem->get_ordered_node(2)->id());
866  nodal_soln[j] = elem_soln[sd_elem->get_ordered_valence(0)];
867 }
libmesh_assert(remote_elem)
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 2, LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 839 of file fe_lagrange.C.

843 { lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 3, LAGRANGE >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 846 of file fe_lagrange.C.

850 { lagrange_nodal_soln(elem, order, elem_soln, nodal_soln); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 0, XYZ >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 866 of file fe_xyz.C.

870 { xyz_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 1, XYZ >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 873 of file fe_xyz.C.

877 { xyz_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 2, XYZ >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 880 of file fe_xyz.C.

884 { xyz_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 3, XYZ >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 887 of file fe_xyz.C.

891 { xyz_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 0, SZABAB >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 1232 of file fe_szabab.C.

1236 { szabab_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/0); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 1, SZABAB >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 1239 of file fe_szabab.C.

1243 { szabab_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/1); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 2, SZABAB >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 1246 of file fe_szabab.C.

1250 { szabab_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/2); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
template<>
void libMesh::FE< 3, SZABAB >::nodal_soln ( const Elem elem,
const Order  order,
const std::vector< Number > &  elem_soln,
std::vector< Number > &  nodal_soln 
)

Definition at line 1253 of file fe_szabab.C.

1257 { szabab_nodal_soln(elem, order, elem_soln, nodal_soln, /*Dim=*/3); }
static void nodal_soln(const Elem *elem, const Order o, const std::vector< Number > &elem_soln, std::vector< Number > &nodal_soln)
bool libMesh::FEAbstract::on_reference_element ( const Point p,
const ElemType  t,
const Real  eps = TOLERANCE 
)
staticinherited
Returns
true if the point p is located on the reference element for element type t, false otherwise. Since we are doing floating point comparisons here the parameter eps can be specified to indicate a tolerance. For example, $ x \le 1 $ becomes $ x \le 1 + \epsilon $.

Definition at line 556 of file fe_abstract.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::INFHEX8, libMesh::INFPRISM6, libMesh::NODEELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::Real, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, and libMesh::TRISHELL3.

Referenced by libMesh::FEInterface::ifem_on_reference_element(), libMesh::FE< Dim, T >::inverse_map(), and libMesh::FEInterface::on_reference_element().

557 {
558  libmesh_assert_greater_equal (eps, 0.);
559 
560  const Real xi = p(0);
561 #if LIBMESH_DIM > 1
562  const Real eta = p(1);
563 #else
564  const Real eta = 0.;
565 #endif
566 #if LIBMESH_DIM > 2
567  const Real zeta = p(2);
568 #else
569  const Real zeta = 0.;
570 #endif
571 
572  switch (t)
573  {
574  case NODEELEM:
575  {
576  return (!xi && !eta && !zeta);
577  }
578  case EDGE2:
579  case EDGE3:
580  case EDGE4:
581  {
582  // The reference 1D element is [-1,1].
583  if ((xi >= -1.-eps) &&
584  (xi <= 1.+eps))
585  return true;
586 
587  return false;
588  }
589 
590 
591  case TRI3:
592  case TRISHELL3:
593  case TRI6:
594  {
595  // The reference triangle is isocoles
596  // and is bound by xi=0, eta=0, and xi+eta=1.
597  if ((xi >= 0.-eps) &&
598  (eta >= 0.-eps) &&
599  ((xi + eta) <= 1.+eps))
600  return true;
601 
602  return false;
603  }
604 
605 
606  case QUAD4:
607  case QUADSHELL4:
608  case QUAD8:
609  case QUAD9:
610  {
611  // The reference quadrilateral element is [-1,1]^2.
612  if ((xi >= -1.-eps) &&
613  (xi <= 1.+eps) &&
614  (eta >= -1.-eps) &&
615  (eta <= 1.+eps))
616  return true;
617 
618  return false;
619  }
620 
621 
622  case TET4:
623  case TET10:
624  {
625  // The reference tetrahedral is isocoles
626  // and is bound by xi=0, eta=0, zeta=0,
627  // and xi+eta+zeta=1.
628  if ((xi >= 0.-eps) &&
629  (eta >= 0.-eps) &&
630  (zeta >= 0.-eps) &&
631  ((xi + eta + zeta) <= 1.+eps))
632  return true;
633 
634  return false;
635  }
636 
637 
638  case HEX8:
639  case HEX20:
640  case HEX27:
641  {
642  /*
643  if ((xi >= -1.) &&
644  (xi <= 1.) &&
645  (eta >= -1.) &&
646  (eta <= 1.) &&
647  (zeta >= -1.) &&
648  (zeta <= 1.))
649  return true;
650  */
651 
652  // The reference hexahedral element is [-1,1]^3.
653  if ((xi >= -1.-eps) &&
654  (xi <= 1.+eps) &&
655  (eta >= -1.-eps) &&
656  (eta <= 1.+eps) &&
657  (zeta >= -1.-eps) &&
658  (zeta <= 1.+eps))
659  {
660  // libMesh::out << "Strange Point:\n";
661  // p.print();
662  return true;
663  }
664 
665  return false;
666  }
667 
668  case PRISM6:
669  case PRISM15:
670  case PRISM18:
671  {
672  // Figure this one out...
673  // inside the reference triange with zeta in [-1,1]
674  if ((xi >= 0.-eps) &&
675  (eta >= 0.-eps) &&
676  (zeta >= -1.-eps) &&
677  (zeta <= 1.+eps) &&
678  ((xi + eta) <= 1.+eps))
679  return true;
680 
681  return false;
682  }
683 
684 
685  case PYRAMID5:
686  case PYRAMID13:
687  case PYRAMID14:
688  {
689  // Check that the point is on the same side of all the faces
690  // by testing whether:
691  //
692  // n_i.(x - x_i) <= 0
693  //
694  // for each i, where:
695  // n_i is the outward normal of face i,
696  // x_i is a point on face i.
697  if ((-eta - 1. + zeta <= 0.+eps) &&
698  ( xi - 1. + zeta <= 0.+eps) &&
699  ( eta - 1. + zeta <= 0.+eps) &&
700  ( -xi - 1. + zeta <= 0.+eps) &&
701  ( zeta >= 0.-eps))
702  return true;
703 
704  return false;
705  }
706 
707 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
708  case INFHEX8:
709  {
710  // The reference infhex8 is a [-1,1]^3.
711  if ((xi >= -1.-eps) &&
712  (xi <= 1.+eps) &&
713  (eta >= -1.-eps) &&
714  (eta <= 1.+eps) &&
715  (zeta >= -1.-eps) &&
716  (zeta <= 1.+eps))
717  {
718  return true;
719  }
720  return false;
721  }
722 
723  case INFPRISM6:
724  {
725  // inside the reference triange with zeta in [-1,1]
726  if ((xi >= 0.-eps) &&
727  (eta >= 0.-eps) &&
728  (zeta >= -1.-eps) &&
729  (zeta <= 1.+eps) &&
730  ((xi + eta) <= 1.+eps))
731  {
732  return true;
733  }
734 
735  return false;
736  }
737 #endif
738 
739  default:
740  libmesh_error_msg("ERROR: Unknown element type " << t);
741  }
742 
743  // If we get here then the point is _not_ in the
744  // reference element. Better return false.
745 
746  return false;
747 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void libMesh::FEGenericBase< FEOutputType< T >::type >::print_d2phi ( std::ostream &  os) const
virtualinherited

Prints the value of each shape function's second derivatives at each quadrature point.

Implements libMesh::FEAbstract.

void libMesh::FEGenericBase< FEOutputType< T >::type >::print_dphi ( std::ostream &  os) const
virtualinherited

Prints the value of each shape function's derivative at each quadrature point.

Implements libMesh::FEAbstract.

void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out)
staticinherited

Prints the reference information, by default to libMesh::out.

Definition at line 88 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter, and libMesh::ReferenceCounter::get_info().

89 {
91 }
static std::string get_info()
void libMesh::FEAbstract::print_info ( std::ostream &  os) const
inherited

Prints all the relevant information about the current element.

Definition at line 764 of file fe_abstract.C.

References libMesh::FEAbstract::print_dphi(), libMesh::FEAbstract::print_JxW(), libMesh::FEAbstract::print_phi(), and libMesh::FEAbstract::print_xyz().

Referenced by libMesh::operator<<().

765 {
766  os << "phi[i][j]: Shape function i at quadrature pt. j" << std::endl;
767  this->print_phi(os);
768 
769  os << "dphi[i][j]: Shape function i's gradient at quadrature pt. j" << std::endl;
770  this->print_dphi(os);
771 
772  os << "XYZ locations of the quadrature pts." << std::endl;
773  this->print_xyz(os);
774 
775  os << "Values of JxW at the quadrature pts." << std::endl;
776  this->print_JxW(os);
777 }
virtual void print_phi(std::ostream &os) const =0
void print_JxW(std::ostream &os) const
Definition: fe_abstract.C:751
void print_xyz(std::ostream &os) const
Definition: fe_abstract.C:758
virtual void print_dphi(std::ostream &os) const =0
void libMesh::FEAbstract::print_JxW ( std::ostream &  os) const
inherited

Prints the Jacobian times the weight for each quadrature point.

Definition at line 751 of file fe_abstract.C.

References libMesh::FEAbstract::_fe_map.

Referenced by libMesh::FEAbstract::print_info().

752 {
753  this->_fe_map->print_JxW(os);
754 }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
void libMesh::FEGenericBase< FEOutputType< T >::type >::print_phi ( std::ostream &  os) const
virtualinherited

Prints the value of each shape function at each quadrature point.

Implements libMesh::FEAbstract.

void libMesh::FEAbstract::print_xyz ( std::ostream &  os) const
inherited

Prints the spatial location of each quadrature point (on the physical element).

Definition at line 758 of file fe_abstract.C.

References libMesh::FEAbstract::_fe_map.

Referenced by libMesh::FEAbstract::print_info().

759 {
760  this->_fe_map->print_xyz(os);
761 }
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
template<unsigned int Dim, FEFamily T>
void libMesh::FE< Dim, T >::reinit ( const Elem elem,
const std::vector< Point > *const  pts = libmesh_nullptr,
const std::vector< Real > *const  weights = libmesh_nullptr 
)
virtual

This is at the core of this class. Use this for each new element in the mesh. Reinitializes all the physical element-dependent data based on the current element elem. By default the shape functions and associated data are computed at the quadrature points specified by the quadrature rule qrule, but may be any points specified on the reference element specified in the optional argument pts.

Implements libMesh::FEAbstract.

Reimplemented in libMesh::FEXYZ< Dim >, and libMesh::FESubdivision.

Definition at line 115 of file fe.C.

References libMesh::INVALID_ELEM, libMesh::libmesh_assert(), libmesh_nullptr, libMesh::Elem::n_nodes(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::SCALAR, and libMesh::Elem::type().

Referenced by libMesh::FEXYZ< Dim >::reinit().

118 {
119  // We can be called with no element. If we're evaluating SCALAR
120  // dofs we'll still have work to do.
121  // libmesh_assert(elem);
122 
123  // We're calculating now! Time to determine what.
124  this->determine_calculations();
125 
126  // Try to avoid calling init_shape_functions
127  // even when shapes_need_reinit
128  bool cached_nodes_still_fit = false;
129 
130  // Most of the hard work happens when we have an actual element
131  if (elem)
132  {
133  // Initialize the shape functions at the user-specified
134  // points
135  if (pts != libmesh_nullptr)
136  {
137  // Set the type and p level for this element
138  this->elem_type = elem->type();
139  this->_p_level = elem->p_level();
140 
141  // Initialize the shape functions
142  this->_fe_map->template init_reference_to_physical_map<Dim>
143  (*pts, elem);
144  this->init_shape_functions (*pts, elem);
145 
146  // The shape functions do not correspond to the qrule
147  this->shapes_on_quadrature = false;
148  }
149 
150  // If there are no user specified points, we use the
151  // quadrature rule
152 
153  // update the type in accordance to the current cell
154  // and reinit if the cell type has changed or (as in
155  // the case of the hierarchics) the shape functions need
156  // reinit, since they depend on the particular element shape
157  else
158  {
159  libmesh_assert(this->qrule);
160  this->qrule->init(elem->type(), elem->p_level());
161 
162  if(this->qrule->shapes_need_reinit())
163  this->shapes_on_quadrature = false;
164 
165  if (this->elem_type != elem->type() ||
166  this->_p_level != elem->p_level() ||
167  !this->shapes_on_quadrature)
168  {
169  // Set the type and p level for this element
170  this->elem_type = elem->type();
171  this->_p_level = elem->p_level();
172  // Initialize the shape functions
173  this->_fe_map->template init_reference_to_physical_map<Dim>
174  (this->qrule->get_points(), elem);
175  this->init_shape_functions (this->qrule->get_points(), elem);
176 
177  if (this->shapes_need_reinit())
178  {
179  cached_nodes.resize(elem->n_nodes());
180  for (unsigned int n = 0; n != elem->n_nodes(); ++n)
181  {
182  cached_nodes[n] = elem->point(n);
183  }
184  }
185  }
186  else
187  {
188  // libmesh_assert_greater (elem->n_nodes(), 1);
189 
190  cached_nodes_still_fit = true;
191  if (cached_nodes.size() != elem->n_nodes())
192  cached_nodes_still_fit = false;
193  else
194  for (unsigned int n = 1; n < elem->n_nodes(); ++n)
195  {
196  if (!(elem->point(n) - elem->point(0)).relative_fuzzy_equals
197  ((cached_nodes[n] - cached_nodes[0]), 1e-13))
198  {
199  cached_nodes_still_fit = false;
200  break;
201  }
202  }
203 
204  if (this->shapes_need_reinit() && !cached_nodes_still_fit)
205  {
206  this->_fe_map->template init_reference_to_physical_map<Dim>
207  (this->qrule->get_points(), elem);
208  this->init_shape_functions (this->qrule->get_points(), elem);
209  cached_nodes.resize(elem->n_nodes());
210  for (unsigned int n = 0; n != elem->n_nodes(); ++n)
211  cached_nodes[n] = elem->point(n);
212  }
213  }
214 
215  // The shape functions correspond to the qrule
216  this->shapes_on_quadrature = true;
217  }
218  }
219  else // With no defined elem, so mapping or caching to
220  // be done, and our "quadrature rule" is one point for nonlocal
221  // (SCALAR) variables and zero points for local variables.
222  {
223  this->elem_type = INVALID_ELEM;
224  this->_p_level = 0;
225 
226  if (!pts)
227  {
228  if (T == SCALAR)
229  {
230  this->qrule->get_points() =
231  std::vector<Point>(1,Point(0));
232 
233  this->qrule->get_weights() =
234  std::vector<Real>(1,1);
235  }
236  else
237  {
238  this->qrule->get_points().clear();
239  this->qrule->get_weights().clear();
240  }
241 
242  this->init_shape_functions (this->qrule->get_points(), elem);
243  }
244  else
245  this->init_shape_functions (*pts, elem);
246  }
247 
248  // Compute the map for this element.
249  if (pts != libmesh_nullptr)
250  {
251  if (weights != libmesh_nullptr)
252  {
253  this->_fe_map->compute_map (this->dim, *weights, elem, this->calculate_d2phi);
254  }
255  else
256  {
257  std::vector<Real> dummy_weights (pts->size(), 1.);
258  this->_fe_map->compute_map (this->dim, dummy_weights, elem, this->calculate_d2phi);
259  }
260  }
261  else
262  {
263  this->_fe_map->compute_map (this->dim, this->qrule->get_weights(), elem, this->calculate_d2phi);
264  }
265 
266  // Compute the shape functions and the derivatives at all of the
267  // quadrature points.
268  if (!cached_nodes_still_fit)
269  {
270  if (pts != libmesh_nullptr)
271  this->compute_shape_functions (elem,*pts);
272  else
273  this->compute_shape_functions(elem,this->qrule->get_points());
274  }
275 }
virtual void init(const ElemType type=INVALID_ELEM, unsigned int p_level=0)
Definition: quadrature.C:28
virtual bool shapes_need_reinit()
Definition: quadrature.h:210
unsigned int _p_level
Definition: fe_abstract.h:571
virtual bool shapes_need_reinit() const libmesh_override
libmesh_assert(remote_elem)
virtual void compute_shape_functions(const Elem *elem, const std::vector< Point > &qp)
const class libmesh_nullptr_t libmesh_nullptr
const unsigned int dim
Definition: fe_abstract.h:516
const std::vector< Real > & get_weights() const
Definition: quadrature.h:140
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
virtual void init_shape_functions(const std::vector< Point > &qp, const Elem *e)
Definition: fe.C:280
const std::vector< Point > & get_points() const
Definition: quadrature.h:129
std::vector< Point > cached_nodes
Definition: fe.h:471
template<unsigned int Dim, FEFamily T>
void libMesh::FE< Dim, T >::reinit ( const Elem elem,
const unsigned int  side,
const Real  tolerance = TOLERANCE,
const std::vector< Point > *const  pts = libmesh_nullptr,
const std::vector< Real > *const  weights = libmesh_nullptr 
)
virtual

Reinitializes all the physical element-dependent data based on the side of face. The tolerance paremeter is passed to the involved call to inverse_map(). By default the shape functions and associated data are computed at the quadrature points specified by the quadrature rule qrule, but may be any points specified on the reference side element specified in the optional argument pts.

Implements libMesh::FEAbstract.

Reimplemented in libMesh::FEXYZ< Dim >, libMesh::FESubdivision, libMesh::FEXYZ< Dim >, and libMesh::FEXYZ< Dim >.

Definition at line 142 of file fe_boundary.C.

References libMesh::Elem::build_side_ptr(), libMesh::libmesh_assert(), libmesh_nullptr, std::max(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::p_level(), side, and libMesh::Elem::type().

147 {
148  libmesh_assert(elem);
150  // We now do this for 1D elements!
151  // libmesh_assert_not_equal_to (Dim, 1);
152 
153  // We're (possibly re-) calculating now! FIXME - we currently
154  // expect to be able to use side_map and JxW later, but we could
155  // optimize further here.
156  this->_fe_map->calculations_started = false;
157  this->_fe_map->get_JxW();
158  this->_fe_map->get_xyz();
159  this->determine_calculations();
160 
161  // Build the side of interest
162  const UniquePtr<const Elem> side(elem->build_side_ptr(s));
163 
164  // Find the max p_level to select
165  // the right quadrature rule for side integration
166  unsigned int side_p_level = elem->p_level();
167  if (elem->neighbor_ptr(s) != libmesh_nullptr)
168  side_p_level = std::max(side_p_level, elem->neighbor_ptr(s)->p_level());
169 
170  // Initialize the shape functions at the user-specified
171  // points
172  if (pts != libmesh_nullptr)
173  {
174  // The shape functions do not correspond to the qrule
175  this->shapes_on_quadrature = false;
176 
177  // Initialize the face shape functions
178  this->_fe_map->template init_face_shape_functions<Dim>(*pts, side.get());
179 
180  // Compute the Jacobian*Weight on the face for integration
181  if (weights != libmesh_nullptr)
182  {
183  this->_fe_map->compute_face_map (Dim, *weights, side.get());
184  }
185  else
186  {
187  std::vector<Real> dummy_weights (pts->size(), 1.);
188  this->_fe_map->compute_face_map (Dim, dummy_weights, side.get());
189  }
190  }
191  // If there are no user specified points, we use the
192  // quadrature rule
193  else
194  {
195  // initialize quadrature rule
196  this->qrule->init(side->type(), side_p_level);
197 
198  if(this->qrule->shapes_need_reinit())
199  this->shapes_on_quadrature = false;
200 
201  // FIXME - could this break if the same FE object was used
202  // for both volume and face integrals? - RHS
203  // We might not need to reinitialize the shape functions
204  if ((this->get_type() != elem->type()) ||
205  (side->type() != last_side) ||
206  (this->get_p_level() != side_p_level) ||
207  this->shapes_need_reinit() ||
208  !this->shapes_on_quadrature)
209  {
210  // Set the element type and p_level
211  this->elem_type = elem->type();
212 
213  // Set the last_side
214  last_side = side->type();
215 
216  // Set the last p level
217  this->_p_level = side_p_level;
218 
219  // Initialize the face shape functions
220  this->_fe_map->template init_face_shape_functions<Dim>(this->qrule->get_points(), side.get());
221  }
222 
223  // Compute the Jacobian*Weight on the face for integration
224  this->_fe_map->compute_face_map (Dim, this->qrule->get_weights(), side.get());
225 
226  // The shape functions correspond to the qrule
227  this->shapes_on_quadrature = true;
228  }
229 
230  // make a copy of the Jacobian for integration
231  const std::vector<Real> JxW_int(this->_fe_map->get_JxW());
232 
233  // make a copy of shape on quadrature info
234  bool shapes_on_quadrature_side = this->shapes_on_quadrature;
235 
236  // Find where the integration points are located on the
237  // full element.
238  const std::vector<Point> * ref_qp;
239  if (pts != libmesh_nullptr)
240  ref_qp = pts;
241  else
242  ref_qp = &this->qrule->get_points();
243 
244  std::vector<Point> qp;
245  this->side_map(elem, side.get(), s, *ref_qp, qp);
246 
247  // compute the shape function and derivative values
248  // at the points qp
249  this->reinit (elem, &qp);
250 
251  this->shapes_on_quadrature = shapes_on_quadrature_side;
252 
253  // copy back old data
254  this->_fe_map->get_JxW() = JxW_int;
255 }
virtual void init(const ElemType type=INVALID_ELEM, unsigned int p_level=0)
Definition: quadrature.C:28
virtual bool shapes_need_reinit()
Definition: quadrature.h:210
virtual void side_map(const Elem *elem, const Elem *side, const unsigned int s, const std::vector< Point > &reference_side_points, std::vector< Point > &reference_points) libmesh_override
Definition: fe_boundary.C:353
unsigned int _p_level
Definition: fe_abstract.h:571
virtual bool shapes_need_reinit() const libmesh_override
libmesh_assert(remote_elem)
unsigned short int side
Definition: xdr_io.C:49
const class libmesh_nullptr_t libmesh_nullptr
long double max(long double a, double b)
ElemType get_type() const
Definition: fe_abstract.h:403
const std::vector< Real > & get_weights() const
Definition: quadrature.h:140
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
virtual void reinit(const Elem *elem, const std::vector< Point > *const pts=libmesh_nullptr, const std::vector< Real > *const weights=libmesh_nullptr) libmesh_override
Definition: fe.C:115
const std::vector< Point > & get_points() const
Definition: quadrature.h:129
ElemType last_side
Definition: fe.h:476
unsigned int get_p_level() const
Definition: fe_abstract.h:409
void libMesh::FEAbstract::set_fe_order ( int  new_order)
inlineinherited

Sets the base FE order of the finite element.

Definition at line 424 of file fe_abstract.h.

References libMesh::FEAbstract::fe_type, and libMesh::FEType::order.

424 { fe_type.order = new_order; }
OrderWrapper order
Definition: fe_type.h:200
template<>
RealGradient libMesh::FE< 2, NEDELEC_ONE >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 29 of file fe_nedelec_one_shape_2D.C.

33 {
34  libmesh_error_msg("Nedelec elements require the element type \nbecause edge orientation is needed.");
35  return RealGradient();
36 }
RealVectorValue RealGradient
template<>
RealGradient libMesh::FE< 3, NEDELEC_ONE >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 29 of file fe_nedelec_one_shape_3D.C.

33 {
34  libmesh_error_msg("Nedelec elements require the element type \nbecause edge orientation is needed.");
35  return RealGradient();
36 }
RealVectorValue RealGradient
template<>
Real libMesh::FE< 3, SCALAR >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 29 of file fe_scalar_shape_3D.C.

33 {
34  return 1.;
35 }
template<>
Real libMesh::FE< 0, SCALAR >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 29 of file fe_scalar_shape_0D.C.

33 {
34  return 1.;
35 }
template<>
Real libMesh::FE< 1, SCALAR >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 29 of file fe_scalar_shape_1D.C.

33 {
34  return 1.;
35 }
template<>
Real libMesh::FE< 2, SCALAR >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 29 of file fe_scalar_shape_2D.C.

33 {
34  return 1.;
35 }
template<>
Real libMesh::FE< 0, L2_HIERARCHIC >::shape ( const ElemType  ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 32 of file fe_l2_hierarchic_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }
template<>
Real libMesh::FE< 2, L2_HIERARCHIC >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 32 of file fe_l2_hierarchic_shape_2D.C.

36 {
37  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge orientation is needed.");
38  return 0.;
39 }
template<>
Real libMesh::FE< 2, LAGRANGE >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 32 of file fe_lagrange_shape_2D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::FIRST, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::Real, libMesh::SECOND, libMesh::TRI3, libMesh::TRI6, and libMesh::TRISHELL3.

36 {
37 #if LIBMESH_DIM > 1
38 
39  switch (order)
40  {
41  // linear Lagrange shape functions
42  case FIRST:
43  {
44  switch (type)
45  {
46  case QUAD4:
47  case QUADSHELL4:
48  case QUAD8:
49  case QUAD9:
50  {
51  // Compute quad shape functions as a tensor-product
52  const Real xi = p(0);
53  const Real eta = p(1);
54 
55  libmesh_assert_less (i, 4);
56 
57  // 0 1 2 3
58  static const unsigned int i0[] = {0, 1, 1, 0};
59  static const unsigned int i1[] = {0, 0, 1, 1};
60 
61  return (FE<1,LAGRANGE>::shape(EDGE2, FIRST, i0[i], xi)*
62  FE<1,LAGRANGE>::shape(EDGE2, FIRST, i1[i], eta));
63  }
64 
65  case TRI3:
66  case TRISHELL3:
67  case TRI6:
68  {
69  const Real zeta1 = p(0);
70  const Real zeta2 = p(1);
71  const Real zeta0 = 1. - zeta1 - zeta2;
72 
73  libmesh_assert_less (i, 3);
74 
75  switch(i)
76  {
77  case 0:
78  return zeta0;
79 
80  case 1:
81  return zeta1;
82 
83  case 2:
84  return zeta2;
85 
86  default:
87  libmesh_error_msg("Invalid shape function index i = " << i);
88  }
89  }
90 
91  default:
92  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
93  }
94  }
95 
96 
97  // quadratic Lagrange shape functions
98  case SECOND:
99  {
100  switch (type)
101  {
102  case QUAD8:
103  {
104  const Real xi = p(0);
105  const Real eta = p(1);
106 
107  libmesh_assert_less (i, 8);
108 
109  switch (i)
110  {
111  case 0:
112  return .25*(1. - xi)*(1. - eta)*(-1. - xi - eta);
113 
114  case 1:
115  return .25*(1. + xi)*(1. - eta)*(-1. + xi - eta);
116 
117  case 2:
118  return .25*(1. + xi)*(1. + eta)*(-1. + xi + eta);
119 
120  case 3:
121  return .25*(1. - xi)*(1. + eta)*(-1. - xi + eta);
122 
123  case 4:
124  return .5*(1. - xi*xi)*(1. - eta);
125 
126  case 5:
127  return .5*(1. + xi)*(1. - eta*eta);
128 
129  case 6:
130  return .5*(1. - xi*xi)*(1. + eta);
131 
132  case 7:
133  return .5*(1. - xi)*(1. - eta*eta);
134 
135  default:
136  libmesh_error_msg("Invalid shape function index i = " << i);
137  }
138  }
139 
140  case QUAD9:
141  {
142  // Compute quad shape functions as a tensor-product
143  const Real xi = p(0);
144  const Real eta = p(1);
145 
146  libmesh_assert_less (i, 9);
147 
148  // 0 1 2 3 4 5 6 7 8
149  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
150  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
151 
152  return (FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], xi)*
153  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i1[i], eta));
154  }
155 
156  case TRI6:
157  {
158  const Real zeta1 = p(0);
159  const Real zeta2 = p(1);
160  const Real zeta0 = 1. - zeta1 - zeta2;
161 
162  libmesh_assert_less (i, 6);
163 
164  switch(i)
165  {
166  case 0:
167  return 2.*zeta0*(zeta0-0.5);
168 
169  case 1:
170  return 2.*zeta1*(zeta1-0.5);
171 
172  case 2:
173  return 2.*zeta2*(zeta2-0.5);
174 
175  case 3:
176  return 4.*zeta0*zeta1;
177 
178  case 4:
179  return 4.*zeta1*zeta2;
180 
181  case 5:
182  return 4.*zeta2*zeta0;
183 
184  default:
185  libmesh_error_msg("Invalid shape function index i = " << i);
186  }
187  }
188 
189  default:
190  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
191  }
192  }
193 
194 
195 
196  // unsupported order
197  default:
198  libmesh_error_msg("ERROR: Unsupported 2D FE order: " << order);
199  }
200 
201  libmesh_error_msg("We'll never get here!");
202 #endif // LIBMESH_DIM > 1
203  return 0.;
204 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, LAGRANGE >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 32 of file fe_lagrange_shape_3D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::FIRST, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::Real, libMesh::SECOND, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, and libMesh::x.

36 {
37 #if LIBMESH_DIM == 3
38 
39 
40  switch (order)
41  {
42  // linear Lagrange shape functions
43  case FIRST:
44  {
45  switch (type)
46  {
47  // trilinear hexahedral shape functions
48  case HEX8:
49  case HEX20:
50  case HEX27:
51  {
52  libmesh_assert_less (i, 8);
53 
54  // Compute hex shape functions as a tensor-product
55  const Real xi = p(0);
56  const Real eta = p(1);
57  const Real zeta = p(2);
58 
59  // 0 1 2 3 4 5 6 7
60  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
61  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
62  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
63 
64  return (FE<1,LAGRANGE>::shape(EDGE2, FIRST, i0[i], xi)*
65  FE<1,LAGRANGE>::shape(EDGE2, FIRST, i1[i], eta)*
66  FE<1,LAGRANGE>::shape(EDGE2, FIRST, i2[i], zeta));
67  }
68 
69  // linear tetrahedral shape functions
70  case TET4:
71  case TET10:
72  {
73  libmesh_assert_less (i, 4);
74 
75  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
76  const Real zeta1 = p(0);
77  const Real zeta2 = p(1);
78  const Real zeta3 = p(2);
79  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
80 
81  switch(i)
82  {
83  case 0:
84  return zeta0;
85 
86  case 1:
87  return zeta1;
88 
89  case 2:
90  return zeta2;
91 
92  case 3:
93  return zeta3;
94 
95  default:
96  libmesh_error_msg("Invalid i = " << i);
97  }
98  }
99 
100  // linear prism shape functions
101  case PRISM6:
102  case PRISM15:
103  case PRISM18:
104  {
105  libmesh_assert_less (i, 6);
106 
107  // Compute prism shape functions as a tensor-product
108  // of a triangle and an edge
109 
110  Point p2d(p(0),p(1));
111  Point p1d(p(2));
112 
113  // 0 1 2 3 4 5
114  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1};
115  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2};
116 
117  return (FE<2,LAGRANGE>::shape(TRI3, FIRST, i1[i], p2d)*
118  FE<1,LAGRANGE>::shape(EDGE2, FIRST, i0[i], p1d));
119  }
120 
121  // linear pyramid shape functions
122  case PYRAMID5:
123  case PYRAMID13:
124  case PYRAMID14:
125  {
126  libmesh_assert_less (i, 5);
127 
128  const Real xi = p(0);
129  const Real eta = p(1);
130  const Real zeta = p(2);
131  const Real eps = 1.e-35;
132 
133  switch(i)
134  {
135  case 0:
136  return .25*(zeta + xi - 1.)*(zeta + eta - 1.)/((1. - zeta) + eps);
137 
138  case 1:
139  return .25*(zeta - xi - 1.)*(zeta + eta - 1.)/((1. - zeta) + eps);
140 
141  case 2:
142  return .25*(zeta - xi - 1.)*(zeta - eta - 1.)/((1. - zeta) + eps);
143 
144  case 3:
145  return .25*(zeta + xi - 1.)*(zeta - eta - 1.)/((1. - zeta) + eps);
146 
147  case 4:
148  return zeta;
149 
150  default:
151  libmesh_error_msg("Invalid i = " << i);
152  }
153  }
154 
155 
156  default:
157  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
158  }
159  }
160 
161 
162  // quadratic Lagrange shape functions
163  case SECOND:
164  {
165  switch (type)
166  {
167 
168  // serendipity hexahedral quadratic shape functions
169  case HEX20:
170  {
171  libmesh_assert_less (i, 20);
172 
173  const Real xi = p(0);
174  const Real eta = p(1);
175  const Real zeta = p(2);
176 
177  // these functions are defined for (x,y,z) in [0,1]^3
178  // so transform the locations
179  const Real x = .5*(xi + 1.);
180  const Real y = .5*(eta + 1.);
181  const Real z = .5*(zeta + 1.);
182 
183  switch (i)
184  {
185  case 0:
186  return (1. - x)*(1. - y)*(1. - z)*(1. - 2.*x - 2.*y - 2.*z);
187 
188  case 1:
189  return x*(1. - y)*(1. - z)*(2.*x - 2.*y - 2.*z - 1.);
190 
191  case 2:
192  return x*y*(1. - z)*(2.*x + 2.*y - 2.*z - 3.);
193 
194  case 3:
195  return (1. - x)*y*(1. - z)*(2.*y - 2.*x - 2.*z - 1.);
196 
197  case 4:
198  return (1. - x)*(1. - y)*z*(2.*z - 2.*x - 2.*y - 1.);
199 
200  case 5:
201  return x*(1. - y)*z*(2.*x - 2.*y + 2.*z - 3.);
202 
203  case 6:
204  return x*y*z*(2.*x + 2.*y + 2.*z - 5.);
205 
206  case 7:
207  return (1. - x)*y*z*(2.*y - 2.*x + 2.*z - 3.);
208 
209  case 8:
210  return 4.*x*(1. - x)*(1. - y)*(1. - z);
211 
212  case 9:
213  return 4.*x*y*(1. - y)*(1. - z);
214 
215  case 10:
216  return 4.*x*(1. - x)*y*(1. - z);
217 
218  case 11:
219  return 4.*(1. - x)*y*(1. - y)*(1. - z);
220 
221  case 12:
222  return 4.*(1. - x)*(1. - y)*z*(1. - z);
223 
224  case 13:
225  return 4.*x*(1. - y)*z*(1. - z);
226 
227  case 14:
228  return 4.*x*y*z*(1. - z);
229 
230  case 15:
231  return 4.*(1. - x)*y*z*(1. - z);
232 
233  case 16:
234  return 4.*x*(1. - x)*(1. - y)*z;
235 
236  case 17:
237  return 4.*x*y*(1. - y)*z;
238 
239  case 18:
240  return 4.*x*(1. - x)*y*z;
241 
242  case 19:
243  return 4.*(1. - x)*y*(1. - y)*z;
244 
245  default:
246  libmesh_error_msg("Invalid i = " << i);
247  }
248  }
249 
250  // triquadraic hexahedral shape funcions
251  case HEX27:
252  {
253  libmesh_assert_less (i, 27);
254 
255  // Compute hex shape functions as a tensor-product
256  const Real xi = p(0);
257  const Real eta = p(1);
258  const Real zeta = p(2);
259 
260  // The only way to make any sense of this
261  // is to look at the mgflo/mg2/mgf documentation
262  // and make the cut-out cube!
263  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
264  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
265  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
266  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
267 
268  return (FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], xi)*
269  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i1[i], eta)*
270  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i2[i], zeta));
271  }
272 
273  // quadratic tetrahedral shape functions
274  case TET10:
275  {
276  libmesh_assert_less (i, 10);
277 
278  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
279  const Real zeta1 = p(0);
280  const Real zeta2 = p(1);
281  const Real zeta3 = p(2);
282  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
283 
284  switch(i)
285  {
286  case 0:
287  return zeta0*(2.*zeta0 - 1.);
288 
289  case 1:
290  return zeta1*(2.*zeta1 - 1.);
291 
292  case 2:
293  return zeta2*(2.*zeta2 - 1.);
294 
295  case 3:
296  return zeta3*(2.*zeta3 - 1.);
297 
298  case 4:
299  return 4.*zeta0*zeta1;
300 
301  case 5:
302  return 4.*zeta1*zeta2;
303 
304  case 6:
305  return 4.*zeta2*zeta0;
306 
307  case 7:
308  return 4.*zeta0*zeta3;
309 
310  case 8:
311  return 4.*zeta1*zeta3;
312 
313  case 9:
314  return 4.*zeta2*zeta3;
315 
316  default:
317  libmesh_error_msg("Invalid i = " << i);
318  }
319  }
320 
321  // "serendipity" prism
322  case PRISM15:
323  {
324  libmesh_assert_less (i, 15);
325 
326  const Real xi = p(0);
327  const Real eta = p(1);
328  const Real zeta = p(2);
329 
330  switch(i)
331  {
332  case 0:
333  return (1. - zeta)*(xi + eta - 1.)*(xi + eta + 0.5*zeta);
334 
335  case 1:
336  return (1. - zeta)*xi*(xi - 1. - 0.5*zeta);
337 
338  case 2: // phi1 with xi <- eta
339  return (1. - zeta)*eta*(eta - 1. - 0.5*zeta);
340 
341  case 3: // phi0 with zeta <- (-zeta)
342  return (1. + zeta)*(xi + eta - 1.)*(xi + eta - 0.5*zeta);
343 
344  case 4: // phi1 with zeta <- (-zeta)
345  return (1. + zeta)*xi*(xi - 1. + 0.5*zeta);
346 
347  case 5: // phi4 with xi <- eta
348  return (1. + zeta)*eta*(eta - 1. + 0.5*zeta);
349 
350  case 6:
351  return 2.*(1. - zeta)*xi*(1. - xi - eta);
352 
353  case 7:
354  return 2.*(1. - zeta)*xi*eta;
355 
356  case 8:
357  return 2.*(1. - zeta)*eta*(1. - xi - eta);
358 
359  case 9:
360  return (1. - zeta)*(1. + zeta)*(1. - xi - eta);
361 
362  case 10:
363  return (1. - zeta)*(1. + zeta)*xi;
364 
365  case 11: // phi10 with xi <-> eta
366  return (1. - zeta)*(1. + zeta)*eta;
367 
368  case 12: // phi6 with zeta <- (-zeta)
369  return 2.*(1. + zeta)*xi*(1. - xi - eta);
370 
371  case 13: // phi7 with zeta <- (-zeta)
372  return 2.*(1. + zeta)*xi*eta;
373 
374  case 14: // phi8 with zeta <- (-zeta)
375  return 2.*(1. + zeta)*eta*(1. - xi - eta);
376 
377  default:
378  libmesh_error_msg("Invalid i = " << i);
379  }
380  }
381 
382  // quadradic prism shape functions
383  case PRISM18:
384  {
385  libmesh_assert_less (i, 18);
386 
387  // Compute prism shape functions as a tensor-product
388  // of a triangle and an edge
389 
390  Point p2d(p(0),p(1));
391  Point p1d(p(2));
392 
393  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
394  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2};
395  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 3, 4, 5};
396 
397  return (FE<2,LAGRANGE>::shape(TRI6, SECOND, i1[i], p2d)*
398  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
399  }
400 
401  // G. Bedrosian, "Shape functions and integration formulas for
402  // three-dimensional finite element analysis", Int. J. Numerical
403  // Methods Engineering, vol 35, p. 95-108, 1992.
404  case PYRAMID13:
405  {
406  libmesh_assert_less (i, 13);
407 
408  const Real xi = p(0);
409  const Real eta = p(1);
410  const Real zeta = p(2);
411  const Real eps = 1.e-35;
412 
413  // Denominators are perturbed by epsilon to avoid
414  // divide-by-zero issues.
415  Real den = (1. - zeta + eps);
416 
417  switch(i)
418  {
419  case 0:
420  return 0.25*(-xi - eta - 1.)*((1. - xi)*(1. - eta) - zeta + xi*eta*zeta/den);
421 
422  case 1:
423  return 0.25*(-eta + xi - 1.)*((1. + xi)*(1. - eta) - zeta - xi*eta*zeta/den);
424 
425  case 2:
426  return 0.25*(xi + eta - 1.)*((1. + xi)*(1. + eta) - zeta + xi*eta*zeta/den);
427 
428  case 3:
429  return 0.25*(eta - xi - 1.)*((1. - xi)*(1. + eta) - zeta - xi*eta*zeta/den);
430 
431  case 4:
432  return zeta*(2.*zeta - 1.);
433 
434  case 5:
435  return 0.5*(1. + xi - zeta)*(1. - xi - zeta)*(1. - eta - zeta)/den;
436 
437  case 6:
438  return 0.5*(1. + eta - zeta)*(1. - eta - zeta)*(1. + xi - zeta)/den;
439 
440  case 7:
441  return 0.5*(1. + xi - zeta)*(1. - xi - zeta)*(1. + eta - zeta)/den;
442 
443  case 8:
444  return 0.5*(1. + eta - zeta)*(1. - eta - zeta)*(1. - xi - zeta)/den;
445 
446  case 9:
447  return zeta*(1. - xi - zeta)*(1. - eta - zeta)/den;
448 
449  case 10:
450  return zeta*(1. + xi - zeta)*(1. - eta - zeta)/den;
451 
452  case 11:
453  return zeta*(1. + eta - zeta)*(1. + xi - zeta)/den;
454 
455  case 12:
456  return zeta*(1. - xi - zeta)*(1. + eta - zeta)/den;
457 
458  default:
459  libmesh_error_msg("Invalid i = " << i);
460  }
461  }
462 
463  // Quadratic shape functions, as defined in R. Graglia, "Higher order
464  // bases on pyramidal elements", IEEE Trans Antennas and Propagation,
465  // vol 47, no 5, May 1999.
466  case PYRAMID14:
467  {
468  libmesh_assert_less (i, 14);
469 
470  const Real xi = p(0);
471  const Real eta = p(1);
472  const Real zeta = p(2);
473  const Real eps = 1.e-35;
474 
475  // The "normalized coordinates" defined by Graglia. These are
476  // the planes which define the faces of the pyramid.
477  Real
478  p1 = 0.5*(1. - eta - zeta), // back
479  p2 = 0.5*(1. + xi - zeta), // left
480  p3 = 0.5*(1. + eta - zeta), // front
481  p4 = 0.5*(1. - xi - zeta); // right
482 
483  // Denominators are perturbed by epsilon to avoid
484  // divide-by-zero issues.
485  Real
486  den = (-1. + zeta + eps),
487  den2 = den*den;
488 
489  switch(i)
490  {
491  case 0:
492  return p4*p1*(xi*eta - zeta + zeta*zeta)/den2;
493 
494  case 1:
495  return -p1*p2*(xi*eta + zeta - zeta*zeta)/den2;
496 
497  case 2:
498  return p2*p3*(xi*eta - zeta + zeta*zeta)/den2;
499 
500  case 3:
501  return -p3*p4*(xi*eta + zeta - zeta*zeta)/den2;
502 
503  case 4:
504  return zeta*(2.*zeta - 1.);
505 
506  case 5:
507  return -4.*p2*p1*p4*eta/den2;
508 
509  case 6:
510  return 4.*p1*p2*p3*xi/den2;
511 
512  case 7:
513  return 4.*p2*p3*p4*eta/den2;
514 
515  case 8:
516  return -4.*p3*p4*p1*xi/den2;
517 
518  case 9:
519  return -4.*p1*p4*zeta/den;
520 
521  case 10:
522  return -4.*p2*p1*zeta/den;
523 
524  case 11:
525  return -4.*p3*p2*zeta/den;
526 
527  case 12:
528  return -4.*p4*p3*zeta/den;
529 
530  case 13:
531  return 16.*p1*p2*p3*p4/den2;
532 
533  default:
534  libmesh_error_msg("Invalid i = " << i);
535  }
536  }
537 
538 
539  default:
540  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
541  }
542  }
543 
544 
545  // unsupported order
546  default:
547  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << order);
548  }
549 
550 #endif
551 
552  libmesh_error_msg("We'll never get here!");
553  return 0.;
554 }
PetscErrorCode Vec x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 0, L2_LAGRANGE >::shape ( const ElemType  ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 32 of file fe_l2_lagrange_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }
template<>
Real libMesh::FE< 1, L2_LAGRANGE >::shape ( const ElemType  ,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 32 of file fe_l2_lagrange_shape_1D.C.

References libMesh::FIRST, libMesh::Real, libMesh::SECOND, and libMesh::THIRD.

36 {
37  const Real xi = p(0);
38 
39 
40  switch (order)
41  {
42  // Lagrange linears
43  case FIRST:
44  {
45  libmesh_assert_less (i, 2);
46 
47  switch (i)
48  {
49  case 0:
50  return .5*(1. - xi);
51 
52  case 1:
53  return .5*(1. + xi);
54 
55  default:
56  libmesh_error_msg("Invalid shape function index i = " << i);
57  }
58  }
59 
60 
61 
62  // Lagrange quadratics
63  case SECOND:
64  {
65  libmesh_assert_less (i, 3);
66 
67  switch (i)
68  {
69  case 0:
70  return .5*xi*(xi - 1.);
71 
72  case 1:
73  return .5*xi*(xi + 1);
74 
75  case 2:
76  return (1. - xi*xi);
77 
78  default:
79  libmesh_error_msg("Invalid shape function index i = " << i);
80  }
81  }
82 
83 
84 
85  // Lagrange cubics
86  case THIRD:
87  {
88  libmesh_assert_less (i, 4);
89 
90  switch (i)
91  {
92  case 0:
93  return 9./16.*(1./9.-xi*xi)*(xi-1.);
94 
95  case 1:
96  return -9./16.*(1./9.-xi*xi)*(xi+1.);
97 
98  case 2:
99  return 27./16.*(1.-xi*xi)*(1./3.-xi);
100 
101  case 3:
102  return 27./16.*(1.-xi*xi)*(1./3.+xi);
103 
104  default:
105  libmesh_error_msg("Invalid shape function index i = " << i);
106  }
107  }
108 
109  default:
110  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
111  }
112 
113  libmesh_error_msg("We'll never get here!");
114  return 0.;
115 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 0, HERMITE >::shape ( const ElemType  ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 32 of file fe_hermite_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }
template<>
Real libMesh::FE< 0, SZABAB >::shape ( const ElemType  ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 32 of file fe_szabab_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }
template<>
Real libMesh::FE< 2, L2_LAGRANGE >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 32 of file fe_l2_lagrange_shape_2D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::FIRST, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::Real, libMesh::SECOND, libMesh::TRI3, libMesh::TRI6, and libMesh::TRISHELL3.

36 {
37 #if LIBMESH_DIM > 1
38 
39  switch (order)
40  {
41  // linear Lagrange shape functions
42  case FIRST:
43  {
44  switch (type)
45  {
46  case QUAD4:
47  case QUADSHELL4:
48  case QUAD8:
49  case QUAD9:
50  {
51  // Compute quad shape functions as a tensor-product
52  const Real xi = p(0);
53  const Real eta = p(1);
54 
55  libmesh_assert_less (i, 4);
56 
57  // 0 1 2 3
58  static const unsigned int i0[] = {0, 1, 1, 0};
59  static const unsigned int i1[] = {0, 0, 1, 1};
60 
61  return (FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i0[i], xi)*
62  FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i1[i], eta));
63  }
64 
65  case TRI3:
66  case TRISHELL3:
67  case TRI6:
68  {
69  const Real zeta1 = p(0);
70  const Real zeta2 = p(1);
71  const Real zeta0 = 1. - zeta1 - zeta2;
72 
73  libmesh_assert_less (i, 3);
74 
75  switch(i)
76  {
77  case 0:
78  return zeta0;
79 
80  case 1:
81  return zeta1;
82 
83  case 2:
84  return zeta2;
85 
86  default:
87  libmesh_error_msg("Invalid shape function index i = " << i);
88  }
89  }
90 
91  default:
92  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
93  }
94  }
95 
96 
97  // quadratic Lagrange shape functions
98  case SECOND:
99  {
100  switch (type)
101  {
102  case QUAD8:
103  {
104  const Real xi = p(0);
105  const Real eta = p(1);
106 
107  libmesh_assert_less (i, 8);
108 
109  switch (i)
110  {
111  case 0:
112  return .25*(1. - xi)*(1. - eta)*(-1. - xi - eta);
113 
114  case 1:
115  return .25*(1. + xi)*(1. - eta)*(-1. + xi - eta);
116 
117  case 2:
118  return .25*(1. + xi)*(1. + eta)*(-1. + xi + eta);
119 
120  case 3:
121  return .25*(1. - xi)*(1. + eta)*(-1. - xi + eta);
122 
123  case 4:
124  return .5*(1. - xi*xi)*(1. - eta);
125 
126  case 5:
127  return .5*(1. + xi)*(1. - eta*eta);
128 
129  case 6:
130  return .5*(1. - xi*xi)*(1. + eta);
131 
132  case 7:
133  return .5*(1. - xi)*(1. - eta*eta);
134 
135  default:
136  libmesh_error_msg("Invalid shape function index i = " << i);
137  }
138  }
139 
140  case QUAD9:
141  {
142  // Compute quad shape functions as a tensor-product
143  const Real xi = p(0);
144  const Real eta = p(1);
145 
146  libmesh_assert_less (i, 9);
147 
148  // 0 1 2 3 4 5 6 7 8
149  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
150  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
151 
152  return (FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], xi)*
153  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i1[i], eta));
154  }
155 
156  case TRI6:
157  {
158  const Real zeta1 = p(0);
159  const Real zeta2 = p(1);
160  const Real zeta0 = 1. - zeta1 - zeta2;
161 
162  libmesh_assert_less (i, 6);
163 
164  switch(i)
165  {
166  case 0:
167  return 2.*zeta0*(zeta0-0.5);
168 
169  case 1:
170  return 2.*zeta1*(zeta1-0.5);
171 
172  case 2:
173  return 2.*zeta2*(zeta2-0.5);
174 
175  case 3:
176  return 4.*zeta0*zeta1;
177 
178  case 4:
179  return 4.*zeta1*zeta2;
180 
181  case 5:
182  return 4.*zeta2*zeta0;
183 
184  default:
185  libmesh_error_msg("Invalid shape function index i = " << i);
186  }
187  }
188 
189  default:
190  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
191  }
192  }
193 
194 
195 
196  // unsupported order
197  default:
198  libmesh_error_msg("ERROR: Unsupported 2D FE order: " << order);
199  }
200 
201  libmesh_error_msg("We'll never get here!");
202  return 0.;
203 
204 #endif
205 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, L2_LAGRANGE >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 32 of file fe_l2_lagrange_shape_3D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::FIRST, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID5, libMesh::Real, libMesh::SECOND, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, and libMesh::x.

36 {
37 #if LIBMESH_DIM == 3
38 
39 
40  switch (order)
41  {
42  // linear Lagrange shape functions
43  case FIRST:
44  {
45  switch (type)
46  {
47  // trilinear hexahedral shape functions
48  case HEX8:
49  case HEX20:
50  case HEX27:
51  {
52  libmesh_assert_less (i, 8);
53 
54  // Compute hex shape functions as a tensor-product
55  const Real xi = p(0);
56  const Real eta = p(1);
57  const Real zeta = p(2);
58 
59  // 0 1 2 3 4 5 6 7
60  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
61  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
62  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
63 
64  return (FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i0[i], xi)*
65  FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i1[i], eta)*
66  FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i2[i], zeta));
67  }
68 
69  // linear tetrahedral shape functions
70  case TET4:
71  case TET10:
72  {
73  libmesh_assert_less (i, 4);
74 
75  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
76  const Real zeta1 = p(0);
77  const Real zeta2 = p(1);
78  const Real zeta3 = p(2);
79  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
80 
81  switch(i)
82  {
83  case 0:
84  return zeta0;
85 
86  case 1:
87  return zeta1;
88 
89  case 2:
90  return zeta2;
91 
92  case 3:
93  return zeta3;
94 
95  default:
96  libmesh_error_msg("Invalid i = " << i);
97  }
98  }
99 
100  // linear prism shape functions
101  case PRISM6:
102  case PRISM15:
103  case PRISM18:
104  {
105  libmesh_assert_less (i, 6);
106 
107  // Compute prism shape functions as a tensor-product
108  // of a triangle and an edge
109 
110  Point p2d(p(0),p(1));
111  Point p1d(p(2));
112 
113  // 0 1 2 3 4 5
114  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1};
115  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2};
116 
117  return (FE<2,L2_LAGRANGE>::shape(TRI3, FIRST, i1[i], p2d)*
118  FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i0[i], p1d));
119  }
120 
121  // linear pyramid shape functions
122  case PYRAMID5:
123  {
124  libmesh_assert_less (i, 5);
125 
126  const Real xi = p(0);
127  const Real eta = p(1);
128  const Real zeta = p(2);
129  const Real eps = 1.e-35;
130 
131  switch(i)
132  {
133  case 0:
134  return .25*(zeta + xi - 1.)*(zeta + eta - 1.)/((1. - zeta) + eps);
135 
136  case 1:
137  return .25*(zeta - xi - 1.)*(zeta + eta - 1.)/((1. - zeta) + eps);
138 
139  case 2:
140  return .25*(zeta - xi - 1.)*(zeta - eta - 1.)/((1. - zeta) + eps);
141 
142  case 3:
143  return .25*(zeta + xi - 1.)*(zeta - eta - 1.)/((1. - zeta) + eps);
144 
145  case 4:
146  return zeta;
147 
148  default:
149  libmesh_error_msg("Invalid i = " << i);
150  }
151  }
152 
153 
154  default:
155  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
156  }
157  }
158 
159 
160  // quadratic Lagrange shape functions
161  case SECOND:
162  {
163  switch (type)
164  {
165 
166  // serendipity hexahedral quadratic shape functions
167  case HEX20:
168  {
169  libmesh_assert_less (i, 20);
170 
171  const Real xi = p(0);
172  const Real eta = p(1);
173  const Real zeta = p(2);
174 
175  // these functions are defined for (x,y,z) in [0,1]^3
176  // so transform the locations
177  const Real x = .5*(xi + 1.);
178  const Real y = .5*(eta + 1.);
179  const Real z = .5*(zeta + 1.);
180 
181  switch (i)
182  {
183  case 0:
184  return (1. - x)*(1. - y)*(1. - z)*(1. - 2.*x - 2.*y - 2.*z);
185 
186  case 1:
187  return x*(1. - y)*(1. - z)*(2.*x - 2.*y - 2.*z - 1.);
188 
189  case 2:
190  return x*y*(1. - z)*(2.*x + 2.*y - 2.*z - 3.);
191 
192  case 3:
193  return (1. - x)*y*(1. - z)*(2.*y - 2.*x - 2.*z - 1.);
194 
195  case 4:
196  return (1. - x)*(1. - y)*z*(2.*z - 2.*x - 2.*y - 1.);
197 
198  case 5:
199  return x*(1. - y)*z*(2.*x - 2.*y + 2.*z - 3.);
200 
201  case 6:
202  return x*y*z*(2.*x + 2.*y + 2.*z - 5.);
203 
204  case 7:
205  return (1. - x)*y*z*(2.*y - 2.*x + 2.*z - 3.);
206 
207  case 8:
208  return 4.*x*(1. - x)*(1. - y)*(1. - z);
209 
210  case 9:
211  return 4.*x*y*(1. - y)*(1. - z);
212 
213  case 10:
214  return 4.*x*(1. - x)*y*(1. - z);
215 
216  case 11:
217  return 4.*(1. - x)*y*(1. - y)*(1. - z);
218 
219  case 12:
220  return 4.*(1. - x)*(1. - y)*z*(1. - z);
221 
222  case 13:
223  return 4.*x*(1. - y)*z*(1. - z);
224 
225  case 14:
226  return 4.*x*y*z*(1. - z);
227 
228  case 15:
229  return 4.*(1. - x)*y*z*(1. - z);
230 
231  case 16:
232  return 4.*x*(1. - x)*(1. - y)*z;
233 
234  case 17:
235  return 4.*x*y*(1. - y)*z;
236 
237  case 18:
238  return 4.*x*(1. - x)*y*z;
239 
240  case 19:
241  return 4.*(1. - x)*y*(1. - y)*z;
242 
243  default:
244  libmesh_error_msg("Invalid i = " << i);
245  }
246  }
247 
248  // triquadraic hexahedral shape funcions
249  case HEX27:
250  {
251  libmesh_assert_less (i, 27);
252 
253  // Compute hex shape functions as a tensor-product
254  const Real xi = p(0);
255  const Real eta = p(1);
256  const Real zeta = p(2);
257 
258  // The only way to make any sense of this
259  // is to look at the mgflo/mg2/mgf documentation
260  // and make the cut-out cube!
261  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
262  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
263  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
264  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
265 
266  return (FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], xi)*
267  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i1[i], eta)*
268  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i2[i], zeta));
269  }
270 
271  // quadratic tetrahedral shape functions
272  case TET10:
273  {
274  libmesh_assert_less (i, 10);
275 
276  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
277  const Real zeta1 = p(0);
278  const Real zeta2 = p(1);
279  const Real zeta3 = p(2);
280  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
281 
282  switch(i)
283  {
284  case 0:
285  return zeta0*(2.*zeta0 - 1.);
286 
287  case 1:
288  return zeta1*(2.*zeta1 - 1.);
289 
290  case 2:
291  return zeta2*(2.*zeta2 - 1.);
292 
293  case 3:
294  return zeta3*(2.*zeta3 - 1.);
295 
296  case 4:
297  return 4.*zeta0*zeta1;
298 
299  case 5:
300  return 4.*zeta1*zeta2;
301 
302  case 6:
303  return 4.*zeta2*zeta0;
304 
305  case 7:
306  return 4.*zeta0*zeta3;
307 
308  case 8:
309  return 4.*zeta1*zeta3;
310 
311  case 9:
312  return 4.*zeta2*zeta3;
313 
314  default:
315  libmesh_error_msg("Invalid i = " << i);
316  }
317  }
318 
319  // quadradic prism shape functions
320  case PRISM18:
321  {
322  libmesh_assert_less (i, 18);
323 
324  // Compute prism shape functions as a tensor-product
325  // of a triangle and an edge
326 
327  Point p2d(p(0),p(1));
328  Point p1d(p(2));
329 
330  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
331  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2};
332  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 3, 4, 5};
333 
334  return (FE<2,L2_LAGRANGE>::shape(TRI6, SECOND, i1[i], p2d)*
335  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
336  }
337 
338 
339  default:
340  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
341  }
342  }
343 
344 
345  // unsupported order
346  default:
347  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << order);
348  }
349 
350 #endif
351 
352  libmesh_error_msg("We'll never get here!");
353  return 0.;
354 }
PetscErrorCode Vec x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, SZABAB >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 32 of file fe_szabab_shape_3D.C.

36 {
37  libmesh_error_msg("Szabo-Babuska polynomials are not defined in 3D");
38  return 0.;
39 }
template<>
Real libMesh::FE< 1, XYZ >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 32 of file fe_xyz_shape_1D.C.

36 {
37  libmesh_error_msg("XYZ polynomials require the element \n because the centroid is needed.");
38  return 0.;
39 }
template<>
Real libMesh::FE< 3, XYZ >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 32 of file fe_xyz_shape_3D.C.

36 {
37  libmesh_error_msg("XYZ polynomials require the element because the centroid is needed.");
38  return 0.;
39 }
template<>
Real libMesh::FE< 0, XYZ >::shape ( const ElemType  ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 32 of file fe_xyz_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }
template<>
Real libMesh::FE< 0, LAGRANGE >::shape ( const ElemType  ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 32 of file fe_lagrange_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }
template<>
Real libMesh::FE< 1, LAGRANGE >::shape ( const ElemType  ,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 32 of file fe_lagrange_shape_1D.C.

References libMesh::FIRST, libMesh::Real, libMesh::SECOND, and libMesh::THIRD.

36 {
37  const Real xi = p(0);
38 
39 
40  switch (order)
41  {
42  // Lagrange linears
43  case FIRST:
44  {
45  libmesh_assert_less (i, 2);
46 
47  switch (i)
48  {
49  case 0:
50  return .5*(1. - xi);
51 
52  case 1:
53  return .5*(1. + xi);
54 
55  default:
56  libmesh_error_msg("Invalid shape function index i = " << i);
57  }
58  }
59 
60 
61 
62  // Lagrange quadratics
63  case SECOND:
64  {
65  libmesh_assert_less (i, 3);
66 
67  switch (i)
68  {
69  case 0:
70  return .5*xi*(xi - 1.);
71 
72  case 1:
73  return .5*xi*(xi + 1);
74 
75  case 2:
76  return (1. - xi*xi);
77 
78  default:
79  libmesh_error_msg("Invalid shape function index i = " << i);
80  }
81  }
82 
83 
84 
85  // Lagrange cubics
86  case THIRD:
87  {
88  libmesh_assert_less (i, 4);
89 
90  switch (i)
91  {
92  case 0:
93  return 9./16.*(1./9.-xi*xi)*(xi-1.);
94 
95  case 1:
96  return -9./16.*(1./9.-xi*xi)*(xi+1.);
97 
98  case 2:
99  return 27./16.*(1.-xi*xi)*(1./3.-xi);
100 
101  case 3:
102  return 27./16.*(1.-xi*xi)*(1./3.+xi);
103 
104  default:
105  libmesh_error_msg("Invalid shape function index i = " << i);
106  }
107  }
108 
109  default:
110  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
111  }
112 
113  libmesh_error_msg("We'll never get here!");
114  return 0.;
115 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 0, HIERARCHIC >::shape ( const ElemType  ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 32 of file fe_hierarchic_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }
template<>
Real libMesh::FE< 2, HIERARCHIC >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 32 of file fe_hierarchic_shape_2D.C.

36 {
37  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge orientation is needed.");
38  return 0.;
39 }
template<>
Real libMesh::FE< 0, CLOUGH >::shape ( const ElemType  ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 32 of file fe_clough_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }
template<>
Real libMesh::FE< 2, XYZ >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 32 of file fe_xyz_shape_2D.C.

36 {
37  libmesh_error_msg("XYZ polynomials require the element \nbecause the centroid is needed.");
38  return 0.;
39 }
template<>
Real libMesh::FE< 0, MONOMIAL >::shape ( const ElemType  ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 32 of file fe_monomial_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }
template<>
Real libMesh::FE< 1, MONOMIAL >::shape ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const Point p 
)

Definition at line 32 of file fe_monomial_shape_1D.C.

References libMesh::Real.

36 {
37  const Real xi = p(0);
38 
39  libmesh_assert_less_equal (i, static_cast<unsigned int>(order));
40 
41  // monomials. since they are hierarchic we only need one case block.
42  switch (i)
43  {
44  case 0:
45  return 1.;
46 
47  case 1:
48  return xi;
49 
50  case 2:
51  return xi*xi;
52 
53  case 3:
54  return xi*xi*xi;
55 
56  case 4:
57  return xi*xi*xi*xi;
58 
59  default:
60  Real val = 1.;
61  for (unsigned int index = 0; index != i; ++index)
62  val *= xi;
63  return val;
64  }
65 
66  libmesh_error_msg("We'll never get here!");
67  return 0.;
68 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, MONOMIAL >::shape ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const Point p 
)

Definition at line 32 of file fe_monomial_shape_2D.C.

References libMesh::Real.

36 {
37 #if LIBMESH_DIM > 1
38 
39  libmesh_assert_less (i, (static_cast<unsigned int>(order)+1)*
40  (static_cast<unsigned int>(order)+2)/2);
41 
42  const Real xi = p(0);
43  const Real eta = p(1);
44 
45  switch (i)
46  {
47  // constant
48  case 0:
49  return 1.;
50 
51  // linear
52  case 1:
53  return xi;
54 
55  case 2:
56  return eta;
57 
58  // quadratics
59  case 3:
60  return xi*xi;
61 
62  case 4:
63  return xi*eta;
64 
65  case 5:
66  return eta*eta;
67 
68  // cubics
69  case 6:
70  return xi*xi*xi;
71 
72  case 7:
73  return xi*xi*eta;
74 
75  case 8:
76  return xi*eta*eta;
77 
78  case 9:
79  return eta*eta*eta;
80 
81  // quartics
82  case 10:
83  return xi*xi*xi*xi;
84 
85  case 11:
86  return xi*xi*xi*eta;
87 
88  case 12:
89  return xi*xi*eta*eta;
90 
91  case 13:
92  return xi*eta*eta*eta;
93 
94  case 14:
95  return eta*eta*eta*eta;
96 
97  default:
98  unsigned int o = 0;
99  for (; i >= (o+1)*(o+2)/2; o++) { }
100  unsigned int ny = i - (o*(o+1)/2);
101  unsigned int nx = o - ny;
102  Real val = 1.;
103  for (unsigned int index=0; index != nx; index++)
104  val *= xi;
105  for (unsigned int index=0; index != ny; index++)
106  val *= eta;
107  return val;
108  }
109 
110  libmesh_error_msg("We'll never get here!");
111  return 0.;
112 
113 #endif
114 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 0, BERNSTEIN >::shape ( const ElemType  ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 32 of file fe_bernstein_shape_0D.C.

36 {
37  libmesh_assert_less (i, 1);
38  return 1.;
39 }
template<>
Real libMesh::FE< 3, MONOMIAL >::shape ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const Point p 
)

Definition at line 32 of file fe_monomial_shape_3D.C.

References libMesh::Real.

36 {
37 #if LIBMESH_DIM == 3
38 
39  const Real xi = p(0);
40  const Real eta = p(1);
41  const Real zeta = p(2);
42 
43  libmesh_assert_less (i, (static_cast<unsigned int>(order)+1)*
44  (static_cast<unsigned int>(order)+2)*
45  (static_cast<unsigned int>(order)+3)/6);
46 
47  // monomials. since they are hierarchic we only need one case block.
48  switch (i)
49  {
50  // constant
51  case 0:
52  return 1.;
53 
54  // linears
55  case 1:
56  return xi;
57 
58  case 2:
59  return eta;
60 
61  case 3:
62  return zeta;
63 
64  // quadratics
65  case 4:
66  return xi*xi;
67 
68  case 5:
69  return xi*eta;
70 
71  case 6:
72  return eta*eta;
73 
74  case 7:
75  return xi*zeta;
76 
77  case 8:
78  return zeta*eta;
79 
80  case 9:
81  return zeta*zeta;
82 
83  // cubics
84  case 10:
85  return xi*xi*xi;
86 
87  case 11:
88  return xi*xi*eta;
89 
90  case 12:
91  return xi*eta*eta;
92 
93  case 13:
94  return eta*eta*eta;
95 
96  case 14:
97  return xi*xi*zeta;
98 
99  case 15:
100  return xi*eta*zeta;
101 
102  case 16:
103  return eta*eta*zeta;
104 
105  case 17:
106  return xi*zeta*zeta;
107 
108  case 18:
109  return eta*zeta*zeta;
110 
111  case 19:
112  return zeta*zeta*zeta;
113 
114  // quartics
115  case 20:
116  return xi*xi*xi*xi;
117 
118  case 21:
119  return xi*xi*xi*eta;
120 
121  case 22:
122  return xi*xi*eta*eta;
123 
124  case 23:
125  return xi*eta*eta*eta;
126 
127  case 24:
128  return eta*eta*eta*eta;
129 
130  case 25:
131  return xi*xi*xi*zeta;
132 
133  case 26:
134  return xi*xi*eta*zeta;
135 
136  case 27:
137  return xi*eta*eta*zeta;
138 
139  case 28:
140  return eta*eta*eta*zeta;
141 
142  case 29:
143  return xi*xi*zeta*zeta;
144 
145  case 30:
146  return xi*eta*zeta*zeta;
147 
148  case 31:
149  return eta*eta*zeta*zeta;
150 
151  case 32:
152  return xi*zeta*zeta*zeta;
153 
154  case 33:
155  return eta*zeta*zeta*zeta;
156 
157  case 34:
158  return zeta*zeta*zeta*zeta;
159 
160  default:
161  unsigned int o = 0;
162  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
163  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
164  unsigned int block=o, nz = 0;
165  for (; block < i2; block += (o-nz+1)) { nz++; }
166  const unsigned int nx = block - i2;
167  const unsigned int ny = o - nx - nz;
168  Real val = 1.;
169  for (unsigned int index=0; index != nx; index++)
170  val *= xi;
171  for (unsigned int index=0; index != ny; index++)
172  val *= eta;
173  for (unsigned int index=0; index != nz; index++)
174  val *= zeta;
175  return val;
176  }
177 
178 #endif
179 
180  libmesh_error_msg("We'll never get here!");
181  return 0.;
182 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, CLOUGH >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 33 of file fe_clough_shape_3D.C.

37 {
38  libmesh_error_msg("Clough-Tocher elements require the real element \nto construct gradient-based degrees of freedom.");
39  return 0.;
40 }
template<>
Real libMesh::FE< 1, L2_HIERARCHIC >::shape ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const Point p 
)

Definition at line 33 of file fe_l2_hierarchic_shape_1D.C.

References libMesh::Utility::pow(), and libMesh::Real.

37 {
38  libmesh_assert_less (i, order+1u);
39 
40  // Declare that we are using our own special power function
41  // from the Utility namespace. This saves typing later.
42  using Utility::pow;
43 
44  const Real xi = p(0);
45 
46  Real returnval = 1.;
47 
48  switch (i)
49  {
50  case 0:
51  returnval = .5*(1. - xi);
52  break;
53  case 1:
54  returnval = .5*(1. + xi);
55  break;
56  // All even-terms have the same form.
57  // (xi^p - 1.)/p!
58  case 2:
59  returnval = (xi*xi - 1.)/2.;
60  break;
61  case 4:
62  returnval = (pow<4>(xi) - 1.)/24.;
63  break;
64  case 6:
65  returnval = (pow<6>(xi) - 1.)/720.;
66  break;
67 
68  // All odd-terms have the same form.
69  // (xi^p - xi)/p!
70  case 3:
71  returnval = (xi*xi*xi - xi)/6.;
72  break;
73  case 5:
74  returnval = (pow<5>(xi) - xi)/120.;
75  break;
76  case 7:
77  returnval = (pow<7>(xi) - xi)/5040.;
78  break;
79  default:
80  Real denominator = 1.;
81  for (unsigned int n=1; n <= i; ++n)
82  {
83  returnval *= xi;
84  denominator *= n;
85  }
86  // Odd:
87  if (i % 2)
88  returnval = (returnval - xi)/denominator;
89  // Even:
90  else
91  returnval = (returnval - 1.)/denominator;
92  break;
93  }
94 
95  return returnval;
96 }
T pow(const T &x)
Definition: utility.h:194
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, HIERARCHIC >::shape ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const Point p 
)

Definition at line 33 of file fe_hierarchic_shape_1D.C.

References libMesh::Utility::pow(), and libMesh::Real.

37 {
38  libmesh_assert_less (i, order+1u);
39 
40  // Declare that we are using our own special power function
41  // from the Utility namespace. This saves typing later.
42  using Utility::pow;
43 
44  const Real xi = p(0);
45 
46  Real returnval = 1.;
47 
48  switch (i)
49  {
50  case 0:
51  returnval = .5*(1. - xi);
52  break;
53  case 1:
54  returnval = .5*(1. + xi);
55  break;
56  // All even-terms have the same form.
57  // (xi^p - 1.)/p!
58  case 2:
59  returnval = (xi*xi - 1.)/2.;
60  break;
61  case 4:
62  returnval = (pow<4>(xi) - 1.)/24.;
63  break;
64  case 6:
65  returnval = (pow<6>(xi) - 1.)/720.;
66  break;
67 
68  // All odd-terms have the same form.
69  // (xi^p - xi)/p!
70  case 3:
71  returnval = (xi*xi*xi - xi)/6.;
72  break;
73  case 5:
74  returnval = (pow<5>(xi) - xi)/120.;
75  break;
76  case 7:
77  returnval = (pow<7>(xi) - xi)/5040.;
78  break;
79  default:
80  Real denominator = 1.;
81  for (unsigned int n=1; n <= i; ++n)
82  {
83  returnval *= xi;
84  denominator *= n;
85  }
86  // Odd:
87  if (i % 2)
88  returnval = (returnval - xi)/denominator;
89  // Even:
90  else
91  returnval = (returnval - 1.)/denominator;
92  break;
93  }
94 
95  return returnval;
96 }
T pow(const T &x)
Definition: utility.h:194
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, BERNSTEIN >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 34 of file fe_bernstein_shape_2D.C.

38 {
39  libmesh_error_msg("Bernstein polynomials require the element type \nbecause edge orientation is needed.");
40  return 0.;
41 }
template<>
Real libMesh::FE< 1, SZABAB >::shape ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const Point p 
)

Definition at line 35 of file fe_szabab_shape_1D.C.

References libMesh::Real, and libMesh::SEVENTH.

39 {
40  const Real xi = p(0);
41  const Real xi2 = xi*xi;
42 
43 
44  // Use this libmesh_assert rather than a switch with a single entry...
45  // It will go away in optimized mode, essentially has the same effect.
46  libmesh_assert_less_equal (order, SEVENTH);
47 
48  // switch (order)
49  // {
50  // case FIRST:
51  // case SECOND:
52  // case THIRD:
53  // case FOURTH:
54  // case FIFTH:
55  // case SIXTH:
56  // case SEVENTH:
57 
58  switch(i)
59  {
60  //nodal shape functions
61  case 0: return 1./2.-1./2.*xi;
62  case 1: return 1./2.+1./2.*xi;
63  case 2: return 1./4. *2.4494897427831780982*(xi2-1.);
64  case 3: return 1./4. *3.1622776601683793320*(xi2-1.)*xi;
65  case 4: return 1./16. *3.7416573867739413856*((5.*xi2-6.)*xi2+1.);
66  case 5: return 3./16. *1.4142135623730950488*(3.+(-10.+7.*xi2)*xi2)*xi;
67  case 6: return 1./32. *4.6904157598234295546*(-1.+(15.+(-35.+21.*xi2)*xi2)*xi2);
68  case 7: return 1./32. *5.0990195135927848300*(-5.+(35.+(-63.+33.*xi2)*xi2)*xi2)*xi;
69  case 8: return 1./256.*5.4772255750516611346*(5.+(-140.+(630.+(-924.+429.*xi2)*xi2)*xi2)*xi2);
70 
71  default:
72  libmesh_error_msg("Invalid shape function index!");
73  }
74 
75  libmesh_error_msg("We'll never get here!");
76  return 0.;
77 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, BERNSTEIN >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 36 of file fe_bernstein_shape_3D.C.

40 {
41  libmesh_error_msg("Bernstein polynomials require the element type \nbecause edge and face orientation is needed.");
42  return 0.;
43 }
template<>
Real libMesh::FE< 1, BERNSTEIN >::shape ( const ElemType  ,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 38 of file fe_bernstein_shape_1D.C.

References libMesh::Utility::binomial(), libMesh::FIFTH, libMesh::FIRST, libMesh::FOURTH, libMesh::libmesh_assert(), std::pow(), libMesh::Utility::pow(), libMesh::Real, libMesh::SECOND, libMesh::SIXTH, and libMesh::THIRD.

42 {
43  const Real xi = p(0);
44  using Utility::pow;
45 
46  switch (order)
47  {
48  case FIRST:
49 
50  switch(i)
51  {
52  case 0:
53  return (1.-xi)/2.;
54  case 1:
55  return (1.+xi)/2.;
56  default:
57  libmesh_error_msg("Invalid shape function index i = " << i);
58  }
59 
60  case SECOND:
61 
62  switch(i)
63  {
64  case 0:
65  return (1./4.)*pow<2>(1.-xi);
66  case 1:
67  return (1./4.)*pow<2>(1.+xi);
68  case 2:
69  return (1./2.)*(1.-xi)*(1.+xi);
70  default:
71  libmesh_error_msg("Invalid shape function index i = " << i);
72  }
73 
74  case THIRD:
75 
76  switch(i)
77  {
78  case 0:
79  return (1./8.)*pow<3>(1.-xi);
80  case 1:
81  return (1./8.)*pow<3>(1.+xi);
82  case 2:
83  return (3./8.)*(1.+xi)*pow<2>(1.-xi);
84  case 3:
85  return (3./8.)*pow<2>(1.+xi)*(1.-xi);
86  default:
87  libmesh_error_msg("Invalid shape function index i = " << i);
88  }
89 
90  case FOURTH:
91 
92  switch(i)
93  {
94  case 0:
95  return (1./16.)*pow<4>(1.-xi);
96  case 1:
97  return (1./16.)*pow<4>(1.+xi);
98  case 2:
99  return (1./ 4.)*(1.+xi)*pow<3>(1.-xi);
100  case 3:
101  return (3./ 8.)*pow<2>(1.+xi)*pow<2>(1.-xi);
102  case 4:
103  return (1./ 4.)*pow<3>(1.+xi)*(1.-xi);
104  default:
105  libmesh_error_msg("Invalid shape function index i = " << i);
106  }
107 
108 
109  case FIFTH:
110 
111  switch(i)
112  {
113  case 0:
114  return (1./32.)*pow<5>(1.-xi);
115  case 1:
116  return (1./32.)*pow<5>(1.+xi);
117  case 2:
118  return (5./32.)*(1.+xi)*pow<4>(1.-xi);
119  case 3:
120  return (5./16.)*pow<2>(1.+xi)*pow<3>(1.-xi);
121  case 4:
122  return (5./16.)*pow<3>(1.+xi)*pow<2>(1.-xi);
123  case 5:
124  return (5./32.)*pow<4>(1.+xi)*(1.-xi);
125  default:
126  libmesh_error_msg("Invalid shape function index i = " << i);
127  }
128 
129 
130  case SIXTH:
131 
132  switch (i)
133  {
134  case 0:
135  return ( 1./64.)*pow<6>(1.-xi);
136  case 1:
137  return ( 1./64.)*pow<6>(1.+xi);
138  case 2:
139  return ( 3./32.)*(1.+xi)*pow<5>(1.-xi);
140  case 3:
141  return (15./64.)*pow<2>(1.+xi)*pow<4>(1.-xi);
142  case 4:
143  return ( 5./16.)*pow<3>(1.+xi)*pow<3>(1.-xi);
144  case 5:
145  return (15./64.)*pow<4>(1.+xi)*pow<2>(1.-xi);
146  case 6:
147  return ( 3./32.)*pow<5>(1.+xi)*(1.-xi);
148  default:
149  libmesh_error_msg("Invalid shape function index i = " << i);
150  }
151 
152  default:
153  {
154  libmesh_assert (order>6);
155 
156  // Use this for arbitrary orders.
157  // Note that this implementation is less efficient.
158  const int p_order = static_cast<int>(order);
159  const int m = p_order-i+1;
160  const int n = (i-1);
161 
162  // Using an unsigned long here will work for any of the orders we support.
163  unsigned long binomial_p_i = 1;
164 
165  // the binomial coefficient (p choose n)
166  if (i>1)
167  binomial_p_i = Utility::binomial(static_cast<unsigned long>(p_order),
168  static_cast<unsigned long>(n));
169 
170  switch(i)
171  {
172  case 0:
173  return binomial_p_i * std::pow((1-xi)/2, p_order);
174  case 1:
175  return binomial_p_i * std::pow((1+xi)/2, p_order);
176  default:
177  {
178  return binomial_p_i * std::pow((1+xi)/2,n)
179  * std::pow((1-xi)/2,m);
180  }
181  }
182  }
183  }
184 
185  libmesh_error_msg("We'll never get here!");
186  return 0.;
187 }
libmesh_assert(remote_elem)
T pow(const T &x)
Definition: utility.h:194
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
T binomial(T n, T k)
Definition: utility.h:221
template<>
Real libMesh::FE< 2, SCALAR >::shape ( const Elem ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 38 of file fe_scalar_shape_2D.C.

42 {
43  return 1.;
44 }
template<>
Real libMesh::FE< 3, SCALAR >::shape ( const Elem ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 38 of file fe_scalar_shape_3D.C.

42 {
43  return 1.;
44 }
template<>
Real libMesh::FE< 0, SCALAR >::shape ( const Elem ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 38 of file fe_scalar_shape_0D.C.

42 {
43  return 1.;
44 }
template<>
Real libMesh::FE< 1, SCALAR >::shape ( const Elem ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 38 of file fe_scalar_shape_1D.C.

42 {
43  return 1.;
44 }
template<>
RealGradient libMesh::FE< 3, NEDELEC_ONE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 41 of file fe_nedelec_one_shape_3D.C.

References libMesh::FIRST, libMesh::HEX20, libMesh::HEX27, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::Real, libMesh::TET10, libMesh::TOLERANCE, and libMesh::Elem::type().

45 {
46 #if LIBMESH_DIM == 3
47  libmesh_assert(elem);
48 
49  const Order totalorder = static_cast<Order>(order + elem->p_level());
50 
51  switch (totalorder)
52  {
53  // linear Lagrange shape functions
54  case FIRST:
55  {
56  switch (elem->type())
57  {
58  case HEX20:
59  case HEX27:
60  {
61  libmesh_assert_less (i, 12);
62 
63  const Real xi = p(0);
64  const Real eta = p(1);
65  const Real zeta = p(2);
66 
67  // Even with a loose inverse_map tolerance we ought to
68  // be nearly on the element interior in master
69  // coordinates
70  libmesh_assert_less_equal ( std::fabs(xi), 1.0+10*TOLERANCE );
71  libmesh_assert_less_equal ( std::fabs(eta), 1.0+10*TOLERANCE );
72  libmesh_assert_less_equal ( std::fabs(zeta), 1.0+10*TOLERANCE );
73 
74  switch(i)
75  {
76  case 0:
77  {
78  if( elem->point(0) > elem->point(1) )
79  return RealGradient( -0.125*(1.0-eta-zeta+eta*zeta), 0.0, 0.0 );
80  else
81  return RealGradient( 0.125*(1.0-eta-zeta+eta*zeta), 0.0, 0.0 );
82  }
83  case 1:
84  {
85  if( elem->point(1) > elem->point(2) )
86  return RealGradient( 0.0, -0.125*(1.0+xi-zeta-xi*zeta), 0.0 );
87  else
88  return RealGradient( 0.0, 0.125*(1.0+xi-zeta-xi*zeta), 0.0 );
89  }
90  case 2:
91  {
92  if( elem->point(2) > elem->point(3) )
93  return RealGradient( 0.125*(1.0+eta-zeta-eta*zeta), 0.0, 0.0 );
94  else
95  return RealGradient( -0.125*(1.0+eta-zeta-eta*zeta), 0.0, 0.0 );
96  }
97  case 3:
98  {
99  if( elem->point(3) > elem->point(0) )
100  return RealGradient( 0.0, 0.125*(1.0-xi-zeta+xi*zeta), 0.0 );
101  else
102  return RealGradient( 0.0, -0.125*(1.0-xi-zeta+xi*zeta), 0.0 );
103  }
104  case 4:
105  {
106  if( elem->point(0) > elem->point(4) )
107  return RealGradient( 0.0, 0.0, -0.125*(1.0-xi-eta+xi*eta) );
108  else
109  return RealGradient( 0.0, 0.0, 0.125*(1.0-xi-eta+xi*eta) );
110  }
111  case 5:
112  {
113  if( elem->point(1) > elem->point(5) )
114  return RealGradient( 0.0, 0.0, -0.125*(1.0+xi-eta-xi*eta) );
115  else
116  return RealGradient( 0.0, 0.0, 0.125*(1.0+xi-eta-xi*eta) );
117  }
118  case 6:
119  {
120  if( elem->point(2) > elem->point(6) )
121  return RealGradient( 0.0, 0.0, -0.125*(1.0+xi+eta+xi*eta) );
122  else
123  return RealGradient( 0.0, 0.0, 0.125*(1.0+xi+eta+xi*eta) );
124  }
125  case 7:
126  {
127  if( elem->point(3) > elem->point(7) )
128  return RealGradient( 0.0, 0.0, -0.125*(1.0-xi+eta-xi*eta) );
129  else
130  return RealGradient( 0.0, 0.0, 0.125*(1.0-xi+eta-xi*eta) );
131  }
132  case 8:
133  {
134  if( elem->point(4) > elem->point(5) )
135  return RealGradient( -0.125*(1.0-eta+zeta-eta*zeta), 0.0, 0.0 );
136  else
137  return RealGradient( 0.125*(1.0-eta+zeta-eta*zeta), 0.0, 0.0 );
138  }
139  case 9:
140  {
141  if( elem->point(5) > elem->point(6) )
142  return RealGradient( 0.0, -0.125*(1.0+xi+zeta+xi*zeta), 0.0 );
143  else
144  return RealGradient( 0.0, 0.125*(1.0+xi+zeta+xi*zeta), 0.0 );
145  }
146  case 10:
147  {
148  if( elem->point(7) > elem->point(6) )
149  return RealGradient( -0.125*(1.0+eta+zeta+eta*zeta), 0.0, 0.0 );
150  else
151  return RealGradient( 0.125*(1.0+eta+zeta+eta*zeta), 0.0, 0.0 );
152  }
153  case 11:
154  {
155  if( elem->point(4) > elem->point(7) )
156  return RealGradient( 0.0, -0.125*(1.0-xi+zeta-xi*zeta), 0.0 );
157  else
158  return RealGradient( 0.0, 0.125*(1.0-xi+zeta-xi*zeta), 0.0 );
159  }
160 
161  default:
162  libmesh_error_msg("Invalid i = " << i);
163  }
164 
165  return RealGradient();
166  }
167 
168  case TET10:
169  {
170  libmesh_assert_less (i, 6);
171 
172  libmesh_not_implemented();
173  return RealGradient();
174  }
175 
176  default:
177  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << elem->type());
178  }
179  }
180 
181  // unsupported order
182  default:
183  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << totalorder);
184  }
185 #endif
186 
187  libmesh_error_msg("We'll never get here!");
188  return RealGradient();
189 }
RealVectorValue RealGradient
libmesh_assert(remote_elem)
static const Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
RealGradient libMesh::FE< 2, NEDELEC_ONE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 42 of file fe_nedelec_one_shape_2D.C.

References libMesh::FIRST, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::QUAD8, libMesh::QUAD9, libMesh::Real, libMesh::TOLERANCE, libMesh::TRI6, and libMesh::Elem::type().

46 {
47 #if LIBMESH_DIM > 1
48  libmesh_assert(elem);
49 
50  const Order total_order = static_cast<Order>(order + elem->p_level());
51 
52  switch (total_order)
53  {
54  case FIRST:
55  {
56  switch (elem->type())
57  {
58  case QUAD8:
59  case QUAD9:
60  {
61  libmesh_assert_less (i, 4);
62 
63  const Real xi = p(0);
64  const Real eta = p(1);
65 
66  // Even with a loose inverse_map tolerance we ought to
67  // be nearly on the element interior in master
68  // coordinates
69  libmesh_assert_less_equal ( std::fabs(xi), 1.0+10*TOLERANCE );
70  libmesh_assert_less_equal ( std::fabs(eta), 1.0+10*TOLERANCE );
71 
72  switch(i)
73  {
74  case 0:
75  {
76  if( elem->point(0) > elem->point(1) )
77  return RealGradient( -0.25*(1.0-eta), 0.0 );
78  else
79  return RealGradient( 0.25*(1.0-eta), 0.0 );
80  }
81  case 1:
82  {
83  if( elem->point(1) > elem->point(2) )
84  return RealGradient( 0.0, -0.25*(1.0+xi) );
85  else
86  return RealGradient( 0.0, 0.25*(1.0+xi) );
87  }
88 
89  case 2:
90  {
91  if( elem->point(2) > elem->point(3) )
92  return RealGradient( 0.25*(1.0+eta), 0.0 );
93  else
94  return RealGradient( -0.25*(1.0+eta), 0.0 );
95  }
96  case 3:
97  {
98  if( elem->point(3) > elem->point(0) )
99  return RealGradient( 0.0, -0.25*(xi-1.0) );
100  else
101  return RealGradient( 0.0, 0.25*(xi-1.0) );
102  }
103 
104  default:
105  libmesh_error_msg("Invalid i = " << i);
106  }
107 
108  return RealGradient();
109  }
110 
111  case TRI6:
112  {
113  const Real xi = p(0);
114  const Real eta = p(1);
115 
116  libmesh_assert_less (i, 3);
117 
118  switch(i)
119  {
120  case 0:
121  {
122  if( elem->point(0) > elem->point(1) )
123  return RealGradient( -1.0+eta, -xi );
124  else
125  return RealGradient( 1.0-eta, xi );
126  }
127  case 1:
128  {
129  if( elem->point(1) > elem->point(2) )
130  return RealGradient( eta, -xi );
131  else
132  return RealGradient( -eta, xi );
133  }
134 
135  case 2:
136  {
137  if( elem->point(2) > elem->point(0) )
138  return RealGradient( eta, -xi+1.0 );
139  else
140  return RealGradient( -eta, xi-1.0 );
141  }
142 
143  default:
144  libmesh_error_msg("Invalid i = " << i);
145  }
146  }
147 
148  default:
149  libmesh_error_msg("ERROR: Unsupported 2D element type!: " << elem->type());
150  }
151  }
152 
153  // unsupported order
154  default:
155  libmesh_error_msg("ERROR: Unsupported 2D FE order!: " << total_order);
156  }
157 #endif // LIBMESH_DIM > 1
158 
159  libmesh_error_msg("We'll never get here!");
160  return RealGradient();
161 }
RealVectorValue RealGradient
libmesh_assert(remote_elem)
static const Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 0, BERNSTEIN >::shape ( const Elem ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 44 of file fe_bernstein_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }
template<>
Real libMesh::FE< 0, L2_HIERARCHIC >::shape ( const Elem ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 44 of file fe_l2_hierarchic_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }
template<>
Real libMesh::FE< 0, L2_LAGRANGE >::shape ( const Elem ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 44 of file fe_l2_lagrange_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }
template<>
Real libMesh::FE< 0, SZABAB >::shape ( const Elem ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 44 of file fe_szabab_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }
template<>
Real libMesh::FE< 3, SZABAB >::shape ( const Elem ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 44 of file fe_szabab_shape_3D.C.

48 {
49  libmesh_error_msg("Szabo-Babuska polynomials are not defined in 3D");
50  return 0.;
51 }
template<>
Real libMesh::FE< 2, L2_HIERARCHIC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 44 of file fe_l2_hierarchic_shape_2D.C.

References libMesh::EDGE3, libMesh::libmesh_assert(), libMesh::libmesh_assert_greater(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::Real, libMesh::FE< Dim, T >::shape(), libMesh::square_number_column, libMesh::square_number_row, libMesh::TRI3, libMesh::TRI6, libMesh::triangular_number_column, libMesh::triangular_number_row, libMesh::TRISHELL3, and libMesh::Elem::type().

48 {
49  libmesh_assert(elem);
50 
51  const Order totalorder = static_cast<Order>(order+elem->p_level());
52  libmesh_assert_greater (totalorder, 0);
53 
54  switch (elem->type())
55  {
56  case TRI3:
57  case TRISHELL3:
58  case TRI6:
59  {
60  const Real zeta1 = p(0);
61  const Real zeta2 = p(1);
62  const Real zeta0 = 1. - zeta1 - zeta2;
63 
64  libmesh_assert_less (i, (totalorder+1u)*(totalorder+2u)/2);
65  libmesh_assert (elem->type() == TRI6 || totalorder < 2);
66 
67  // Vertex DoFs
68  if (i == 0)
69  return zeta0;
70  else if (i == 1)
71  return zeta1;
72  else if (i == 2)
73  return zeta2;
74  // Edge DoFs
75  else if (i < totalorder + 2u)
76  {
77  // Avoid returning NaN on vertices!
78  if (zeta0 + zeta1 == 0.)
79  return 0.;
80 
81  const unsigned int basisorder = i - 1;
82  // Get factors to account for edge-flipping
83  Real f0 = 1;
84  if (basisorder%2 && (elem->point(0) > elem->point(1)))
85  f0 = -1.;
86 
87  Real edgeval = (zeta1 - zeta0) / (zeta1 + zeta0);
88  Real crossfunc = zeta0 + zeta1;
89  for (unsigned int n=1; n != basisorder; ++n)
90  crossfunc *= (zeta0 + zeta1);
91 
92  return f0 * crossfunc *
94  basisorder, edgeval);
95  }
96  else if (i < 2u*totalorder + 1)
97  {
98  // Avoid returning NaN on vertices!
99  if (zeta1 + zeta2 == 0.)
100  return 0.;
101 
102  const unsigned int basisorder = i - totalorder;
103  // Get factors to account for edge-flipping
104  Real f1 = 1;
105  if (basisorder%2 && (elem->point(1) > elem->point(2)))
106  f1 = -1.;
107 
108  Real edgeval = (zeta2 - zeta1) / (zeta2 + zeta1);
109  Real crossfunc = zeta2 + zeta1;
110  for (unsigned int n=1; n != basisorder; ++n)
111  crossfunc *= (zeta2 + zeta1);
112 
113  return f1 * crossfunc *
114  FE<1,L2_HIERARCHIC>::shape(EDGE3, totalorder,
115  basisorder, edgeval);
116  }
117  else if (i < 3u*totalorder)
118  {
119  // Avoid returning NaN on vertices!
120  if (zeta0 + zeta2 == 0.)
121  return 0.;
122 
123  const unsigned int basisorder = i - (2u*totalorder) + 1;
124  // Get factors to account for edge-flipping
125  Real f2 = 1;
126  if (basisorder%2 && (elem->point(2) > elem->point(0)))
127  f2 = -1.;
128 
129  Real edgeval = (zeta0 - zeta2) / (zeta0 + zeta2);
130  Real crossfunc = zeta0 + zeta2;
131  for (unsigned int n=1; n != basisorder; ++n)
132  crossfunc *= (zeta0 + zeta2);
133 
134  return f2 * crossfunc *
135  FE<1,L2_HIERARCHIC>::shape(EDGE3, totalorder,
136  basisorder, edgeval);
137  }
138  // Interior DoFs
139  else
140  {
141  const unsigned int basisnum = i - (3u*totalorder);
142  unsigned int exp0 = triangular_number_column[basisnum] + 1;
143  unsigned int exp1 = triangular_number_row[basisnum] + 1 -
144  triangular_number_column[basisnum];
145 
146  Real returnval = 1;
147  for (unsigned int n = 0; n != exp0; ++n)
148  returnval *= zeta0;
149  for (unsigned int n = 0; n != exp1; ++n)
150  returnval *= zeta1;
151  returnval *= zeta2;
152  return returnval;
153  }
154  }
155 
156  // Hierarchic shape functions on the quadrilateral.
157  case QUAD4:
158  case QUADSHELL4:
159  libmesh_assert_less (totalorder, 2);
160  case QUAD8:
161  case QUAD9:
162  {
163  // Compute quad shape functions as a tensor-product
164  const Real xi = p(0);
165  const Real eta = p(1);
166 
167  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
168 
169  // Example i, i0, i1 values for totalorder = 5:
170  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
171  // static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 0, 0, 0, 0, 2, 3, 3, 2, 4, 4, 4, 3, 2, 5, 5, 5, 5, 4, 3, 2};
172  // static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 2, 2, 3, 3, 2, 3, 4, 4, 4, 2, 3, 4, 5, 5, 5, 5};
173 
174  unsigned int i0, i1;
175 
176  // Vertex DoFs
177  if (i == 0)
178  { i0 = 0; i1 = 0; }
179  else if (i == 1)
180  { i0 = 1; i1 = 0; }
181  else if (i == 2)
182  { i0 = 1; i1 = 1; }
183  else if (i == 3)
184  { i0 = 0; i1 = 1; }
185  // Edge DoFs
186  else if (i < totalorder + 3u)
187  { i0 = i - 2; i1 = 0; }
188  else if (i < 2u*totalorder + 2)
189  { i0 = 1; i1 = i - totalorder - 1; }
190  else if (i < 3u*totalorder + 1)
191  { i0 = i - 2u*totalorder; i1 = 1; }
192  else if (i < 4u*totalorder)
193  { i0 = 0; i1 = i - 3u*totalorder + 1; }
194  // Interior DoFs
195  else
196  {
197  unsigned int basisnum = i - 4*totalorder;
198  i0 = square_number_column[basisnum] + 2;
199  i1 = square_number_row[basisnum] + 2;
200  }
201 
202  // Flip odd degree of freedom values if necessary
203  // to keep continuity on sides
204  Real f = 1.;
205 
206  if ((i0%2) && (i0 > 2) && (i1 == 0))
207  f = (elem->point(0) > elem->point(1))?-1.:1.;
208  else if ((i0%2) && (i0>2) && (i1 == 1))
209  f = (elem->point(3) > elem->point(2))?-1.:1.;
210  else if ((i0 == 0) && (i1%2) && (i1>2))
211  f = (elem->point(0) > elem->point(3))?-1.:1.;
212  else if ((i0 == 1) && (i1%2) && (i1>2))
213  f = (elem->point(1) > elem->point(2))?-1.:1.;
214 
215  return f*(FE<1,L2_HIERARCHIC>::shape(EDGE3, totalorder, i0, xi)*
216  FE<1,L2_HIERARCHIC>::shape(EDGE3, totalorder, i1, eta));
217  }
218 
219  default:
220  libmesh_error_msg("ERROR: Unsupported element type = " << elem->type());
221  }
222 
223  return 0.;
224 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
const unsigned char triangular_number_row[]
const unsigned char square_number_column[]
libmesh_assert_greater(libMeshPrivateData::_n_processors, 0)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned char triangular_number_column[]
const unsigned char square_number_row[]
template<>
Real libMesh::FE< 1, XYZ >::shape ( const Elem elem,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const Point point_in 
)

Definition at line 44 of file fe_xyz_shape_1D.C.

References std::abs(), libMesh::Elem::centroid(), libMesh::libmesh_assert(), std::max(), libMesh::Elem::n_nodes(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::Real, and libMesh::x.

48 {
49  libmesh_assert(elem);
50  libmesh_assert_less_equal (i, order + elem->p_level());
51 
52  Point centroid = elem->centroid();
53  Real max_distance = 0.;
54  for (unsigned int p = 0; p < elem->n_nodes(); p++)
55  {
56  const Real distance = std::abs(centroid(0) - elem->point(p)(0));
57  max_distance = std::max(distance, max_distance);
58  }
59 
60  const Real x = point_in(0);
61  const Real xc = centroid(0);
62  const Real dx = (x - xc)/max_distance;
63 
64  // monomials. since they are hierarchic we only need one case block.
65  switch (i)
66  {
67  case 0:
68  return 1.;
69 
70  case 1:
71  return dx;
72 
73  case 2:
74  return dx*dx;
75 
76  case 3:
77  return dx*dx*dx;
78 
79  case 4:
80  return dx*dx*dx*dx;
81 
82  default:
83  Real val = 1.;
84  for (unsigned int index = 0; index != i; ++index)
85  val *= dx;
86  return val;
87  }
88 
89  libmesh_error_msg("We'll never get here!");
90  return 0.;
91 
92 }
double abs(double a)
libmesh_assert(remote_elem)
long double max(long double a, double b)
PetscErrorCode Vec x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, XYZ >::shape ( const Elem elem,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const Point point_in 
)

Definition at line 44 of file fe_xyz_shape_3D.C.

References std::abs(), libMesh::Elem::centroid(), libMesh::libmesh_assert(), std::max(), libMesh::Elem::n_nodes(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::Real, and libMesh::x.

48 {
49 #if LIBMESH_DIM == 3
50  libmesh_assert(elem);
51 
52  Point centroid = elem->centroid();
53  Point max_distance = Point(0.,0.,0.);
54  for (unsigned int p = 0; p < elem->n_nodes(); p++)
55  for (unsigned int d = 0; d < 3; d++)
56  {
57  const Real distance = std::abs(centroid(d) - elem->point(p)(d));
58  max_distance(d) = std::max(distance, max_distance(d));
59  }
60 
61  const Real x = point_in(0);
62  const Real y = point_in(1);
63  const Real z = point_in(2);
64  const Real xc = centroid(0);
65  const Real yc = centroid(1);
66  const Real zc = centroid(2);
67  const Real distx = max_distance(0);
68  const Real disty = max_distance(1);
69  const Real distz = max_distance(2);
70  const Real dx = (x - xc)/distx;
71  const Real dy = (y - yc)/disty;
72  const Real dz = (z - zc)/distz;
73 
74 #ifndef NDEBUG
75  // totalorder is only used in the assertion below, so
76  // we avoid declaring it when asserts are not active.
77  const unsigned int totalorder = order + elem->p_level();
78 #endif
79  libmesh_assert_less (i, (static_cast<unsigned int>(totalorder)+1)*
80  (static_cast<unsigned int>(totalorder)+2)*
81  (static_cast<unsigned int>(totalorder)+3)/6);
82 
83  // monomials. since they are hierarchic we only need one case block.
84  switch (i)
85  {
86  // constant
87  case 0:
88  return 1.;
89 
90  // linears
91  case 1:
92  return dx;
93 
94  case 2:
95  return dy;
96 
97  case 3:
98  return dz;
99 
100  // quadratics
101  case 4:
102  return dx*dx;
103 
104  case 5:
105  return dx*dy;
106 
107  case 6:
108  return dy*dy;
109 
110  case 7:
111  return dx*dz;
112 
113  case 8:
114  return dz*dy;
115 
116  case 9:
117  return dz*dz;
118 
119  // cubics
120  case 10:
121  return dx*dx*dx;
122 
123  case 11:
124  return dx*dx*dy;
125 
126  case 12:
127  return dx*dy*dy;
128 
129  case 13:
130  return dy*dy*dy;
131 
132  case 14:
133  return dx*dx*dz;
134 
135  case 15:
136  return dx*dy*dz;
137 
138  case 16:
139  return dy*dy*dz;
140 
141  case 17:
142  return dx*dz*dz;
143 
144  case 18:
145  return dy*dz*dz;
146 
147  case 19:
148  return dz*dz*dz;
149 
150  // quartics
151  case 20:
152  return dx*dx*dx*dx;
153 
154  case 21:
155  return dx*dx*dx*dy;
156 
157  case 22:
158  return dx*dx*dy*dy;
159 
160  case 23:
161  return dx*dy*dy*dy;
162 
163  case 24:
164  return dy*dy*dy*dy;
165 
166  case 25:
167  return dx*dx*dx*dz;
168 
169  case 26:
170  return dx*dx*dy*dz;
171 
172  case 27:
173  return dx*dy*dy*dz;
174 
175  case 28:
176  return dy*dy*dy*dz;
177 
178  case 29:
179  return dx*dx*dz*dz;
180 
181  case 30:
182  return dx*dy*dz*dz;
183 
184  case 31:
185  return dy*dy*dz*dz;
186 
187  case 32:
188  return dx*dz*dz*dz;
189 
190  case 33:
191  return dy*dz*dz*dz;
192 
193  case 34:
194  return dz*dz*dz*dz;
195 
196  default:
197  unsigned int o = 0;
198  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
199  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
200  unsigned int block=o, nz = 0;
201  for (; block < i2; block += (o-nz+1)) { nz++; }
202  const unsigned int nx = block - i2;
203  const unsigned int ny = o - nx - nz;
204  Real val = 1.;
205  for (unsigned int index=0; index != nx; index++)
206  val *= dx;
207  for (unsigned int index=0; index != ny; index++)
208  val *= dy;
209  for (unsigned int index=0; index != nz; index++)
210  val *= dz;
211  return val;
212  }
213 
214 #endif
215 
216  libmesh_error_msg("We'll never get here!");
217  return 0.;
218 }
double abs(double a)
libmesh_assert(remote_elem)
long double max(long double a, double b)
PetscErrorCode Vec x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 0, HERMITE >::shape ( const Elem ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 44 of file fe_hermite_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }
template<>
Real libMesh::FE< 0, XYZ >::shape ( const Elem ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 44 of file fe_xyz_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }
template<>
Real libMesh::FE< 2, XYZ >::shape ( const Elem elem,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const Point point_in 
)

Definition at line 44 of file fe_xyz_shape_2D.C.

References std::abs(), libMesh::Elem::centroid(), libMesh::libmesh_assert(), std::max(), libMesh::Elem::n_nodes(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::Real, and libMesh::x.

48 {
49 #if LIBMESH_DIM > 1
50 
51  libmesh_assert(elem);
52 
53  Point centroid = elem->centroid();
54  Point max_distance = Point(0.,0.,0.);
55  for (unsigned int p = 0; p < elem->n_nodes(); p++)
56  for (unsigned int d = 0; d < 2; d++)
57  {
58  const Real distance = std::abs(centroid(d) - elem->point(p)(d));
59  max_distance(d) = std::max(distance, max_distance(d));
60  }
61 
62  const Real x = point_in(0);
63  const Real y = point_in(1);
64  const Real xc = centroid(0);
65  const Real yc = centroid(1);
66  const Real distx = max_distance(0);
67  const Real disty = max_distance(1);
68  const Real dx = (x - xc)/distx;
69  const Real dy = (y - yc)/disty;
70 
71 #ifndef NDEBUG
72  // totalorder is only used in the assertion below, so
73  // we avoid declaring it when asserts are not active.
74  const unsigned int totalorder = order + elem->p_level();
75 #endif
76  libmesh_assert_less (i, (totalorder+1)*(totalorder+2)/2);
77 
78 
79  // monomials. since they are hierarchic we only need one case block.
80  switch (i)
81  {
82  // constant
83  case 0:
84  return 1.;
85 
86  // linear
87  case 1:
88  return dx;
89 
90  case 2:
91  return dy;
92 
93  // quadratics
94  case 3:
95  return dx*dx;
96 
97  case 4:
98  return dx*dy;
99 
100  case 5:
101  return dy*dy;
102 
103  // cubics
104  case 6:
105  return dx*dx*dx;
106 
107  case 7:
108  return dx*dx*dy;
109 
110  case 8:
111  return dx*dy*dy;
112 
113  case 9:
114  return dy*dy*dy;
115 
116  // quartics
117  case 10:
118  return dx*dx*dx*dx;
119 
120  case 11:
121  return dx*dx*dx*dy;
122 
123  case 12:
124  return dx*dx*dy*dy;
125 
126  case 13:
127  return dx*dy*dy*dy;
128 
129  case 14:
130  return dy*dy*dy*dy;
131 
132  default:
133  unsigned int o = 0;
134  for (; i >= (o+1)*(o+2)/2; o++) { }
135  unsigned int i2 = i - (o*(o+1)/2);
136  Real val = 1.;
137  for (unsigned int index=i2; index != o; index++)
138  val *= dx;
139  for (unsigned int index=0; index != i2; index++)
140  val *= dy;
141  return val;
142  }
143 
144  libmesh_error_msg("We'll never get here!");
145  return 0.;
146 
147 #endif
148 }
double abs(double a)
libmesh_assert(remote_elem)
long double max(long double a, double b)
PetscErrorCode Vec x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 0, HIERARCHIC >::shape ( const Elem ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 44 of file fe_hierarchic_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }
template<>
Real libMesh::FE< 0, LAGRANGE >::shape ( const Elem ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 44 of file fe_lagrange_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }
template<>
Real libMesh::FE< 2, HIERARCHIC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 44 of file fe_hierarchic_shape_2D.C.

References libMesh::EDGE3, libMesh::libmesh_assert(), libMesh::libmesh_assert_greater(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::Real, libMesh::FE< Dim, T >::shape(), libMesh::square_number_column, libMesh::square_number_row, libMesh::TRI3, libMesh::TRI6, libMesh::triangular_number_column, libMesh::triangular_number_row, libMesh::TRISHELL3, and libMesh::Elem::type().

48 {
49  libmesh_assert(elem);
50 
51  const Order totalorder = static_cast<Order>(order+elem->p_level());
52  libmesh_assert_greater (totalorder, 0);
53 
54  switch (elem->type())
55  {
56  case TRI3:
57  case TRISHELL3:
58  case TRI6:
59  {
60  const Real zeta1 = p(0);
61  const Real zeta2 = p(1);
62  const Real zeta0 = 1. - zeta1 - zeta2;
63 
64  libmesh_assert_less (i, (totalorder+1u)*(totalorder+2u)/2);
65  libmesh_assert (elem->type() == TRI6 || totalorder < 2);
66 
67  // Vertex DoFs
68  if (i == 0)
69  return zeta0;
70  else if (i == 1)
71  return zeta1;
72  else if (i == 2)
73  return zeta2;
74  // Edge DoFs
75  else if (i < totalorder + 2u)
76  {
77  // Avoid returning NaN on vertices!
78  if (zeta0 + zeta1 == 0.)
79  return 0.;
80 
81  const unsigned int basisorder = i - 1;
82  // Get factors to account for edge-flipping
83  Real f0 = 1;
84  if (basisorder%2 && (elem->point(0) > elem->point(1)))
85  f0 = -1.;
86 
87  Real edgeval = (zeta1 - zeta0) / (zeta1 + zeta0);
88  Real crossfunc = zeta0 + zeta1;
89  for (unsigned int n=1; n != basisorder; ++n)
90  crossfunc *= (zeta0 + zeta1);
91 
92  return f0 * crossfunc *
93  FE<1,HIERARCHIC>::shape(EDGE3, totalorder,
94  basisorder, edgeval);
95  }
96  else if (i < 2u*totalorder + 1)
97  {
98  // Avoid returning NaN on vertices!
99  if (zeta1 + zeta2 == 0.)
100  return 0.;
101 
102  const unsigned int basisorder = i - totalorder;
103  // Get factors to account for edge-flipping
104  Real f1 = 1;
105  if (basisorder%2 && (elem->point(1) > elem->point(2)))
106  f1 = -1.;
107 
108  Real edgeval = (zeta2 - zeta1) / (zeta2 + zeta1);
109  Real crossfunc = zeta2 + zeta1;
110  for (unsigned int n=1; n != basisorder; ++n)
111  crossfunc *= (zeta2 + zeta1);
112 
113  return f1 * crossfunc *
114  FE<1,HIERARCHIC>::shape(EDGE3, totalorder,
115  basisorder, edgeval);
116  }
117  else if (i < 3u*totalorder)
118  {
119  // Avoid returning NaN on vertices!
120  if (zeta0 + zeta2 == 0.)
121  return 0.;
122 
123  const unsigned int basisorder = i - (2u*totalorder) + 1;
124  // Get factors to account for edge-flipping
125  Real f2 = 1;
126  if (basisorder%2 && (elem->point(2) > elem->point(0)))
127  f2 = -1.;
128 
129  Real edgeval = (zeta0 - zeta2) / (zeta0 + zeta2);
130  Real crossfunc = zeta0 + zeta2;
131  for (unsigned int n=1; n != basisorder; ++n)
132  crossfunc *= (zeta0 + zeta2);
133 
134  return f2 * crossfunc *
135  FE<1,HIERARCHIC>::shape(EDGE3, totalorder,
136  basisorder, edgeval);
137  }
138  // Interior DoFs
139  else
140  {
141  const unsigned int basisnum = i - (3u*totalorder);
142  unsigned int exp0 = triangular_number_column[basisnum] + 1;
143  unsigned int exp1 = triangular_number_row[basisnum] + 1 -
144  triangular_number_column[basisnum];
145 
146  Real returnval = 1;
147  for (unsigned int n = 0; n != exp0; ++n)
148  returnval *= zeta0;
149  for (unsigned int n = 0; n != exp1; ++n)
150  returnval *= zeta1;
151  returnval *= zeta2;
152  return returnval;
153  }
154  }
155 
156  // Hierarchic shape functions on the quadrilateral.
157  case QUAD4:
158  case QUADSHELL4:
159  libmesh_assert_less (totalorder, 2);
160  case QUAD8:
161  case QUAD9:
162  {
163  // Compute quad shape functions as a tensor-product
164  const Real xi = p(0);
165  const Real eta = p(1);
166 
167  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
168 
169  // Example i, i0, i1 values for totalorder = 5:
170  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
171  // static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 0, 0, 0, 0, 2, 3, 3, 2, 4, 4, 4, 3, 2, 5, 5, 5, 5, 4, 3, 2};
172  // static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 2, 2, 3, 3, 2, 3, 4, 4, 4, 2, 3, 4, 5, 5, 5, 5};
173 
174  unsigned int i0, i1;
175 
176  // Vertex DoFs
177  if (i == 0)
178  { i0 = 0; i1 = 0; }
179  else if (i == 1)
180  { i0 = 1; i1 = 0; }
181  else if (i == 2)
182  { i0 = 1; i1 = 1; }
183  else if (i == 3)
184  { i0 = 0; i1 = 1; }
185  // Edge DoFs
186  else if (i < totalorder + 3u)
187  { i0 = i - 2; i1 = 0; }
188  else if (i < 2u*totalorder + 2)
189  { i0 = 1; i1 = i - totalorder - 1; }
190  else if (i < 3u*totalorder + 1)
191  { i0 = i - 2u*totalorder; i1 = 1; }
192  else if (i < 4u*totalorder)
193  { i0 = 0; i1 = i - 3u*totalorder + 1; }
194  // Interior DoFs
195  else
196  {
197  unsigned int basisnum = i - 4*totalorder;
198  i0 = square_number_column[basisnum] + 2;
199  i1 = square_number_row[basisnum] + 2;
200  }
201 
202  // Flip odd degree of freedom values if necessary
203  // to keep continuity on sides
204  Real f = 1.;
205 
206  if ((i0%2) && (i0 > 2) && (i1 == 0))
207  f = (elem->point(0) > elem->point(1))?-1.:1.;
208  else if ((i0%2) && (i0>2) && (i1 == 1))
209  f = (elem->point(3) > elem->point(2))?-1.:1.;
210  else if ((i0 == 0) && (i1%2) && (i1>2))
211  f = (elem->point(0) > elem->point(3))?-1.:1.;
212  else if ((i0 == 1) && (i1%2) && (i1>2))
213  f = (elem->point(1) > elem->point(2))?-1.:1.;
214 
215  return f*(FE<1,HIERARCHIC>::shape(EDGE3, totalorder, i0, xi)*
216  FE<1,HIERARCHIC>::shape(EDGE3, totalorder, i1, eta));
217  }
218 
219  default:
220  libmesh_error_msg("ERROR: Unsupported element type = " << elem->type());
221  }
222 
223  return 0.;
224 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
const unsigned char triangular_number_row[]
const unsigned char square_number_column[]
libmesh_assert_greater(libMeshPrivateData::_n_processors, 0)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned char triangular_number_column[]
const unsigned char square_number_row[]
template<>
Real libMesh::FE< 0, CLOUGH >::shape ( const Elem ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 44 of file fe_clough_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }
template<>
Real libMesh::FE< 0, MONOMIAL >::shape ( const Elem ,
const Order  ,
const unsigned int   libmesh_dbg_vari,
const Point  
)

Definition at line 44 of file fe_monomial_shape_0D.C.

48 {
49  libmesh_assert_less (i, 1);
50  return 1.;
51 }
template<>
Real libMesh::FE< 3, CLOUGH >::shape ( const Elem libmesh_dbg_varelem,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 45 of file fe_clough_shape_3D.C.

References libMesh::libmesh_assert().

49 {
50  libmesh_assert(elem);
51 
52  libmesh_not_implemented();
53  return 0.;
54 }
libmesh_assert(remote_elem)
template<>
Real libMesh::FE< 2, BERNSTEIN >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 46 of file fe_bernstein_shape_2D.C.

References libMesh::EDGE3, libMesh::FIFTH, libMesh::FIRST, libMesh::FOURTH, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::Utility::pow(), libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::Real, libMesh::SECOND, libMesh::FE< Dim, T >::shape(), libMesh::SIXTH, libMesh::square_number_column, libMesh::square_number_row, libMesh::THIRD, libMesh::TRI3, libMesh::TRI6, libMesh::TRISHELL3, libMesh::Elem::type(), and libMesh::x.

50 {
51  libmesh_assert(elem);
52 
53  const ElemType type = elem->type();
54 
55  const Order totalorder = static_cast<Order>(order + elem->p_level());
56 
57  // Declare that we are using our own special power function
58  // from the Utility namespace. This saves typing later.
59  using Utility::pow;
60 
61  switch (type)
62  {
63  // Hierarchic shape functions on the quadrilateral.
64  case QUAD4:
65  case QUADSHELL4:
66  case QUAD9:
67  {
68  // Compute quad shape functions as a tensor-product
69  const Real xi = p(0);
70  const Real eta = p(1);
71 
72  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
73 
74  // Example i, i0, i1 values for totalorder = 5:
75  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
76  // static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 0, 0, 0, 0, 2, 3, 3, 2, 4, 4, 4, 3, 2, 5, 5, 5, 5, 4, 3, 2};
77  // static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 2, 2, 3, 3, 2, 3, 4, 4, 4, 2, 3, 4, 5, 5, 5, 5};
78 
79  unsigned int i0, i1;
80 
81  // Vertex DoFs
82  if (i == 0)
83  { i0 = 0; i1 = 0; }
84  else if (i == 1)
85  { i0 = 1; i1 = 0; }
86  else if (i == 2)
87  { i0 = 1; i1 = 1; }
88  else if (i == 3)
89  { i0 = 0; i1 = 1; }
90 
91 
92  // Edge DoFs
93  else if (i < totalorder + 3u)
94  { i0 = i - 2; i1 = 0; }
95  else if (i < 2u*totalorder + 2)
96  { i0 = 1; i1 = i - totalorder - 1; }
97  else if (i < 3u*totalorder + 1)
98  { i0 = i - 2u*totalorder; i1 = 1; }
99  else if (i < 4u*totalorder)
100  { i0 = 0; i1 = i - 3u*totalorder + 1; }
101  // Interior DoFs. Use Roy's number look up
102  else
103  {
104  unsigned int basisnum = i - 4*totalorder;
105  i0 = square_number_column[basisnum] + 2;
106  i1 = square_number_row[basisnum] + 2;
107  }
108 
109 
110  // Flip odd degree of freedom values if necessary
111  // to keep continuity on sides.
112  if ((i>= 4 && i<= 4+ totalorder-2u) && elem->point(0) > elem->point(1)) i0=totalorder+2-i0;//
113  else if((i>= 4+ totalorder-1u && i<= 4+2*totalorder-3u) && elem->point(1) > elem->point(2)) i1=totalorder+2-i1;
114  else if((i>= 4+2*totalorder-2u && i<= 4+3*totalorder-4u) && elem->point(3) > elem->point(2)) i0=totalorder+2-i0;
115  else if((i>= 4+3*totalorder-3u && i<= 4+4*totalorder-5u) && elem->point(0) > elem->point(3)) i1=totalorder+2-i1;
116 
117 
118  return (FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0, xi)*
119  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1, eta));
120  }
121  // handle serendipity QUAD8 element separately
122  case QUAD8:
123  {
124  libmesh_assert_less (totalorder, 3);
125 
126  const Real xi = p(0);
127  const Real eta = p(1);
128 
129  libmesh_assert_less (i, 8);
130 
131  // 0 1 2 3 4 5 6 7 8
132  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
133  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
134  static const Real scal[] = {-0.25, -0.25, -0.25, -0.25, 0.5, 0.5, 0.5, 0.5};
135 
136  //B_t,i0(i)|xi * B_s,i1(i)|eta + scal(i) * B_t,2|xi * B_t,2|eta
137  return (FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[i], xi)*
138  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[i], eta)
139  +scal[i]*
140  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[8], xi)*
141  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[8], eta));
142 
143  }
144 
145  case TRI3:
146  case TRISHELL3:
147  libmesh_assert_less (totalorder, 2);
148  case TRI6:
149  switch (totalorder)
150  {
151  case FIRST:
152  {
153  const Real x=p(0);
154  const Real y=p(1);
155  const Real r=1.-x-y;
156 
157  libmesh_assert_less (i, 3);
158 
159  switch(i)
160  {
161  case 0: return r; //f0,0,1
162  case 1: return x; //f0,1,1
163  case 2: return y; //f1,0,1
164 
165  default:
166  libmesh_error_msg("Invalid shape function index i = " << i);
167  }
168  }
169  case SECOND:
170  {
171  const Real x=p(0);
172  const Real y=p(1);
173  const Real r=1.-x-y;
174 
175  libmesh_assert_less (i, 6);
176 
177  switch(i)
178  {
179  case 0: return r*r;
180  case 1: return x*x;
181  case 2: return y*y;
182 
183  case 3: return 2.*x*r;
184  case 4: return 2.*x*y;
185  case 5: return 2.*r*y;
186 
187  default:
188  libmesh_error_msg("Invalid shape function index i = " << i);
189  }
190  }
191  case THIRD:
192  {
193  const Real x=p(0);
194  const Real y=p(1);
195  const Real r=1.-x-y;
196  libmesh_assert_less (i, 10);
197 
198  unsigned int shape=i;
199 
200 
201  if((i==3||i==4) && elem->point(0) > elem->point(1)) shape=7-i;
202  if((i==5||i==6) && elem->point(1) > elem->point(2)) shape=11-i;
203  if((i==7||i==8) && elem->point(0) > elem->point(2)) shape=15-i;
204 
205  switch(shape)
206  {
207  case 0: return r*r*r;
208  case 1: return x*x*x;
209  case 2: return y*y*y;
210 
211  case 3: return 3.*x*r*r;
212  case 4: return 3.*x*x*r;
213 
214  case 5: return 3.*y*x*x;
215  case 6: return 3.*y*y*x;
216 
217  case 7: return 3.*y*r*r;
218  case 8: return 3.*y*y*r;
219 
220  case 9: return 6.*x*y*r;
221 
222  default:
223  libmesh_error_msg("Invalid shape function index shape = " << shape);
224  }
225  }
226  case FOURTH:
227  {
228  const Real x=p(0);
229  const Real y=p(1);
230  const Real r=1-x-y;
231  unsigned int shape=i;
232 
233  libmesh_assert_less (i, 15);
234 
235  if((i==3||i== 5) && elem->point(0) > elem->point(1))shape=8-i;
236  if((i==6||i== 8) && elem->point(1) > elem->point(2))shape=14-i;
237  if((i==9||i==11) && elem->point(0) > elem->point(2))shape=20-i;
238 
239 
240  switch(shape)
241  {
242  // point functions
243  case 0: return r*r*r*r;
244  case 1: return x*x*x*x;
245  case 2: return y*y*y*y;
246 
247  // edge functions
248  case 3: return 4.*x*r*r*r;
249  case 4: return 6.*x*x*r*r;
250  case 5: return 4.*x*x*x*r;
251 
252  case 6: return 4.*y*x*x*x;
253  case 7: return 6.*y*y*x*x;
254  case 8: return 4.*y*y*y*x;
255 
256  case 9: return 4.*y*r*r*r;
257  case 10: return 6.*y*y*r*r;
258  case 11: return 4.*y*y*y*r;
259 
260  // inner functions
261  case 12: return 12.*x*y*r*r;
262  case 13: return 12.*x*x*y*r;
263  case 14: return 12.*x*y*y*r;
264 
265  default:
266  libmesh_error_msg("Invalid shape function index shape = " << shape);
267  }
268  }
269  case FIFTH:
270  {
271  const Real x=p(0);
272  const Real y=p(1);
273  const Real r=1-x-y;
274  unsigned int shape=i;
275 
276  libmesh_assert_less (i, 21);
277 
278  if((i>= 3&&i<= 6) && elem->point(0) > elem->point(1))shape=9-i;
279  if((i>= 7&&i<=10) && elem->point(1) > elem->point(2))shape=17-i;
280  if((i>=11&&i<=14) && elem->point(0) > elem->point(2))shape=25-i;
281 
282  switch(shape)
283  {
284  //point functions
285  case 0: return pow<5>(r);
286  case 1: return pow<5>(x);
287  case 2: return pow<5>(y);
288 
289  //edge functions
290  case 3: return 5.*x *pow<4>(r);
291  case 4: return 10.*pow<2>(x)*pow<3>(r);
292  case 5: return 10.*pow<3>(x)*pow<2>(r);
293  case 6: return 5.*pow<4>(x)*r;
294 
295  case 7: return 5.*y *pow<4>(x);
296  case 8: return 10.*pow<2>(y)*pow<3>(x);
297  case 9: return 10.*pow<3>(y)*pow<2>(x);
298  case 10: return 5.*pow<4>(y)*x;
299 
300  case 11: return 5.*y *pow<4>(r);
301  case 12: return 10.*pow<2>(y)*pow<3>(r);
302  case 13: return 10.*pow<3>(y)*pow<2>(r);
303  case 14: return 5.*pow<4>(y)*r;
304 
305  //inner functions
306  case 15: return 20.*x*y*pow<3>(r);
307  case 16: return 30.*x*pow<2>(y)*pow<2>(r);
308  case 17: return 30.*pow<2>(x)*y*pow<2>(r);
309  case 18: return 20.*x*pow<3>(y)*r;
310  case 19: return 20.*pow<3>(x)*y*r;
311  case 20: return 30.*pow<2>(x)*pow<2>(y)*r;
312 
313  default:
314  libmesh_error_msg("Invalid shape function index shape = " << shape);
315  }
316  }
317  case SIXTH:
318  {
319  const Real x=p(0);
320  const Real y=p(1);
321  const Real r=1-x-y;
322  unsigned int shape=i;
323 
324  libmesh_assert_less (i, 28);
325 
326  if((i>= 3&&i<= 7) && elem->point(0) > elem->point(1))shape=10-i;
327  if((i>= 8&&i<=12) && elem->point(1) > elem->point(2))shape=20-i;
328  if((i>=13&&i<=17) && elem->point(0) > elem->point(2))shape=30-i;
329 
330  switch(shape)
331  {
332  //point functions
333  case 0: return pow<6>(r);
334  case 1: return pow<6>(x);
335  case 2: return pow<6>(y);
336 
337  //edge functions
338  case 3: return 6.*x *pow<5>(r);
339  case 4: return 15.*pow<2>(x)*pow<4>(r);
340  case 5: return 20.*pow<3>(x)*pow<3>(r);
341  case 6: return 15.*pow<4>(x)*pow<2>(r);
342  case 7: return 6.*pow<5>(x)*r;
343 
344  case 8: return 6.*y *pow<5>(x);
345  case 9: return 15.*pow<2>(y)*pow<4>(x);
346  case 10: return 20.*pow<3>(y)*pow<3>(x);
347  case 11: return 15.*pow<4>(y)*pow<2>(x);
348  case 12: return 6.*pow<5>(y)*x;
349 
350  case 13: return 6.*y *pow<5>(r);
351  case 14: return 15.*pow<2>(y)*pow<4>(r);
352  case 15: return 20.*pow<3>(y)*pow<3>(r);
353  case 16: return 15.*pow<4>(y)*pow<2>(r);
354  case 17: return 6.*pow<5>(y)*r;
355 
356  //inner functions
357  case 18: return 30.*x*y*pow<4>(r);
358  case 19: return 60.*x*pow<2>(y)*pow<3>(r);
359  case 20: return 60.* pow<2>(x)*y*pow<3>(r);
360  case 21: return 60.*x*pow<3>(y)*pow<2>(r);
361  case 22: return 60.*pow<3>(x)*y*pow<2>(r);
362  case 23: return 90.*pow<2>(x)*pow<2>(y)*pow<2>(r);
363  case 24: return 30.*x*pow<4>(y)*r;
364  case 25: return 60.*pow<2>(x)*pow<3>(y)*r;
365  case 26: return 60.*pow<3>(x)*pow<2>(y)*r;
366  case 27: return 30.*pow<4>(x)*y*r;
367 
368  default:
369  libmesh_error_msg("Invalid shape function index shape = " << shape);
370  } // switch shape
371  } // case TRI6
372  default:
373  libmesh_error_msg("Invalid totalorder = " << totalorder);
374  } // switch order
375 
376  default:
377  libmesh_error_msg("ERROR: Unsupported element type = " << type);
378  } // switch type
379 
380  libmesh_error_msg("We'll never get here!");
381  return 0.;
382 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
const unsigned char square_number_column[]
T pow(const T &x)
Definition: utility.h:194
PetscErrorCode Vec x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned char square_number_row[]
template<>
Real libMesh::FE< 3, BERNSTEIN >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 48 of file fe_bernstein_shape_3D.C.

References libMesh::EDGE3, libMesh::FIRST, libMesh::FOURTH, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::libmesh_assert(), std::min(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::Real, libMesh::SECOND, libMesh::FE< Dim, T >::shape(), libMesh::TET10, libMesh::TET4, libMesh::THIRD, and libMesh::Elem::type().

52 {
53 
54 #if LIBMESH_DIM == 3
55 
56  libmesh_assert(elem);
57  const ElemType type = elem->type();
58 
59  const Order totalorder = static_cast<Order>(order + elem->p_level());
60 
61  switch (totalorder)
62  {
63  // 1st order Bernstein.
64  case FIRST:
65  {
66  switch (type)
67  {
68 
69  // Bernstein shape functions on the tetrahedron.
70  case TET4:
71  case TET10:
72  {
73  libmesh_assert_less (i, 4);
74 
75  // Area coordinates
76  const Real zeta1 = p(0);
77  const Real zeta2 = p(1);
78  const Real zeta3 = p(2);
79  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
80 
81  switch(i)
82  {
83  case 0: return zeta0;
84  case 1: return zeta1;
85  case 2: return zeta2;
86  case 3: return zeta3;
87 
88  default:
89  libmesh_error_msg("Invalid shape function index i = " << i);
90  }
91  }
92 
93  // Bernstein shape functions on the hexahedral.
94  case HEX8:
95  case HEX20:
96  case HEX27:
97  {
98  libmesh_assert_less (i, 8);
99 
100  // Compute hex shape functions as a tensor-product
101  const Real xi = p(0);
102  const Real eta = p(1);
103  const Real zeta = p(2);
104 
105  // The only way to make any sense of this
106  // is to look at the mgflo/mg2/mgf documentation
107  // and make the cut-out cube!
108  // 0 1 2 3 4 5 6 7
109  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
110  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
111  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
112 
113  return (FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[i], xi)*
114  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[i], eta)*
115  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[i], zeta));
116  }
117 
118 
119  default:
120  libmesh_error_msg("Invalid element type = " << type);
121  }
122  }
123 
124 
125 
126 
127  case SECOND:
128  {
129  switch (type)
130  {
131 
132  // Bernstein shape functions on the tetrahedron.
133  case TET10:
134  {
135  libmesh_assert_less (i, 10);
136 
137  // Area coordinates
138  const Real zeta1 = p(0);
139  const Real zeta2 = p(1);
140  const Real zeta3 = p(2);
141  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
142 
143  switch(i)
144  {
145  case 0: return zeta0*zeta0;
146  case 1: return zeta1*zeta1;
147  case 2: return zeta2*zeta2;
148  case 3: return zeta3*zeta3;
149  case 4: return 2.*zeta0*zeta1;
150  case 5: return 2.*zeta1*zeta2;
151  case 6: return 2.*zeta0*zeta2;
152  case 7: return 2.*zeta3*zeta0;
153  case 8: return 2.*zeta1*zeta3;
154  case 9: return 2.*zeta2*zeta3;
155 
156  default:
157  libmesh_error_msg("Invalid shape function index i = " << i);
158  }
159  }
160 
161  // Bernstein shape functions on the 20-noded hexahedral.
162  case HEX20:
163  {
164  libmesh_assert_less (i, 20);
165 
166  // Compute hex shape functions as a tensor-product
167  const Real xi = p(0);
168  const Real eta = p(1);
169  const Real zeta = p(2);
170 
171  // The only way to make any sense of this
172  // is to look at the mgflo/mg2/mgf documentation
173  // and make the cut-out cube!
174  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
175  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
176  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
177  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
178  //To compute the hex20 shape functions the original shape functions for hex27 are used.
179  //scalx[i] tells how often the original x-th shape function has to be added to the original i-th shape function
180  //to compute the new i-th shape function for hex20
181  //example: B_0^HEX20 = B_0^HEX27 - 0.25*B_20^HEX27 - 0.25*B_21^HEX27 + 0*B_22^HEX27 + 0*B_23^HEX27 - 0.25*B_24^HEX27 + 0*B_25^HEX27 - 0.25*B_26^HEX27
182  // B_0^HEX20 = B_0^HEX27 + scal20[0]*B_20^HEX27 + scal21[0]*B_21^HEX27 + ...
183  static const Real scal20[] = {-0.25, -0.25, -0.25, -0.25, 0, 0, 0, 0, 0.5, 0.5, 0.5, 0.5, 0, 0, 0, 0, 0, 0, 0, 0};
184  static const Real scal21[] = {-0.25, -0.25, 0, 0, -0.25, -0.25, 0, 0, 0.5, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0, 0, 0};
185  static const Real scal22[] = {0, -0.25, -0.25, 0, 0, -0.25, -0.25, 0, 0, 0.5, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0, 0};
186  static const Real scal23[] = {0, 0, -0.25, -0.25, 0, 0, -0.25, -0.25, 0, 0, 0.5, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0};
187  static const Real scal24[] = {-0.25, 0, 0, -0.25, -0.25, 0, 0, -0.25, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0, 0, 0, 0.5};
188  static const Real scal25[] = {0, 0, 0, 0, -0.25, -0.25, -0.25, -0.25, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0.5, 0.5, 0.5};
189  static const Real scal26[] = {-0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25};
190 
191  return (FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[i], xi)*
192  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[i], eta)*
193  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[i], zeta)
194  +scal20[i]*
195  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[20], xi)*
196  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[20], eta)*
197  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[20], zeta)
198  +scal21[i]*
199  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[21], xi)*
200  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[21], eta)*
201  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[21], zeta)
202  +scal22[i]*
203  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[22], xi)*
204  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[22], eta)*
205  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[22], zeta)
206  +scal23[i]*
207  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[23], xi)*
208  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[23], eta)*
209  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[23], zeta)
210  +scal24[i]*
211  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[24], xi)*
212  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[24], eta)*
213  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[24], zeta)
214  +scal25[i]*
215  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[25], xi)*
216  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[25], eta)*
217  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[25], zeta)
218  +scal26[i]*
219  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[26], xi)*
220  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[26], eta)*
221  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[26], zeta));
222  }
223 
224  // Bernstein shape functions on the hexahedral.
225  case HEX27:
226  {
227  libmesh_assert_less (i, 27);
228 
229  // Compute hex shape functions as a tensor-product
230  const Real xi = p(0);
231  const Real eta = p(1);
232  const Real zeta = p(2);
233 
234  // The only way to make any sense of this
235  // is to look at the mgflo/mg2/mgf documentation
236  // and make the cut-out cube!
237  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
238  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
239  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
240  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
241 
242  return (FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[i], xi)*
243  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[i], eta)*
244  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[i], zeta));
245  }
246 
247 
248  default:
249  libmesh_error_msg("Invalid element type = " << type);
250  }
251 
252  }
253 
254 
255 
256  // 3rd-order Bernstein.
257  case THIRD:
258  {
259  switch (type)
260  {
261 
262  // // Bernstein shape functions on the tetrahedron.
263  // case TET10:
264  // {
265  // libmesh_assert_less (i, 20);
266 
267  // // Area coordinates
268  // const Real zeta1 = p(0);
269  // const Real zeta2 = p(1);
270  // const Real zeta3 = p(2);
271  // const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
272 
273 
274  // unsigned int shape=i;
275 
276  // // handle the edge orientation
277 
278  // if ((i== 4||i== 5) && elem->node_id(0) > elem->node_id(1))shape= 9-i; //Edge 0
279  // if ((i== 6||i== 7) && elem->node_id(1) > elem->node_id(2))shape=13-i; //Edge 1
280  // if ((i== 8||i== 9) && elem->node_id(0) > elem->node_id(2))shape=17-i; //Edge 2
281  // if ((i==10||i==11) && elem->node_id(0) > elem->node_id(3))shape=21-i; //Edge 3
282  // if ((i==12||i==13) && elem->node_id(1) > elem->node_id(3))shape=25-i; //Edge 4
283  // if ((i==14||i==15) && elem->node_id(2) > elem->node_id(3))shape=29-i; //Edge 5
284 
285  // // No need to handle face orientation in 3rd order.
286 
287 
288  // switch(shape)
289  // {
290  // //point function
291  // case 0: return zeta0*zeta0*zeta0;
292  // case 1: return zeta1*zeta1*zeta1;
293  // case 2: return zeta2*zeta2*zeta2;
294  // case 3: return zeta3*zeta3*zeta3;
295 
296  // //edge functions
297  // case 4: return 3.*zeta0*zeta0*zeta1;
298  // case 5: return 3.*zeta1*zeta1*zeta0;
299 
300  // case 6: return 3.*zeta1*zeta1*zeta2;
301  // case 7: return 3.*zeta2*zeta2*zeta1;
302 
303  // case 8: return 3.*zeta0*zeta0*zeta2;
304  // case 9: return 3.*zeta2*zeta2*zeta0;
305 
306  // case 10: return 3.*zeta0*zeta0*zeta3;
307  // case 11: return 3.*zeta3*zeta3*zeta0;
308 
309  // case 12: return 3.*zeta1*zeta1*zeta3;
310  // case 13: return 3.*zeta3*zeta3*zeta1;
311 
312  // case 14: return 3.*zeta2*zeta2*zeta3;
313  // case 15: return 3.*zeta3*zeta3*zeta2;
314 
315  // //face functions
316  // case 16: return 6.*zeta0*zeta1*zeta2;
317  // case 17: return 6.*zeta0*zeta1*zeta3;
318  // case 18: return 6.*zeta1*zeta2*zeta3;
319  // case 19: return 6.*zeta2*zeta0*zeta3;
320 
321  // default:
322  // libmesh_error_msg("Invalid shape function index i = " << i);
323  // }
324  // }
325 
326 
327  // Bernstein shape functions on the hexahedral.
328  case HEX27:
329  {
330  libmesh_assert_less (i, 64);
331 
332  // Compute hex shape functions as a tensor-product
333  const Real xi = p(0);
334  const Real eta = p(1);
335  const Real zeta = p(2);
336  Real xi_mapped = p(0);
337  Real eta_mapped = p(1);
338  Real zeta_mapped = p(2);
339 
340  // The only way to make any sense of this
341  // is to look at the mgflo/mg2/mgf documentation
342  // and make the cut-out cube!
343  // Nodes 0 1 2 3 4 5 6 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 24 24 25 25 25 25 26 26 26 26 26 26 26 26
344  // DOFS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 18 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 60 62 63
345  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 3, 1, 1, 2, 3, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 0, 0, 2, 3, 2, 3, 2, 3, 2, 3, 1, 1, 1, 1, 2, 3, 2, 3, 0, 0, 0, 0, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3};
346  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 2, 2, 3, 3, 0, 0, 0, 0, 2, 3, 2, 3, 1, 1, 1, 1, 2, 3, 2, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3};
347  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 2, 3, 2, 3, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3};
348 
349 
350 
351  // handle the edge orientation
352  {
353  // Edge 0
354  if ( (i0[i] >= 2) && (i1[i] == 0) && (i2[i] == 0))
355  {
356  if (elem->point(0) != std::min(elem->point(0), elem->point(1)))
357  xi_mapped = -xi;
358  }
359  // Edge 1
360  else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] == 0))
361  {
362  if (elem->point(1) != std::min(elem->point(1), elem->point(2)))
363  eta_mapped = -eta;
364  }
365  // Edge 2
366  else if ((i0[i] >= 2) && (i1[i] == 1) && (i2[i] == 0))
367  {
368  if (elem->point(3) != std::min(elem->point(3), elem->point(2)))
369  xi_mapped = -xi;
370  }
371  // Edge 3
372  else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] == 0))
373  {
374  if (elem->point(0) != std::min(elem->point(0), elem->point(3)))
375  eta_mapped = -eta;
376  }
377  // Edge 4
378  else if ((i0[i] == 0) && (i1[i] == 0) && (i2[i] >=2 ))
379  {
380  if (elem->point(0) != std::min(elem->point(0), elem->point(4)))
381  zeta_mapped = -zeta;
382  }
383  // Edge 5
384  else if ((i0[i] == 1) && (i1[i] == 0) && (i2[i] >=2 ))
385  {
386  if (elem->point(1) != std::min(elem->point(1), elem->point(5)))
387  zeta_mapped = -zeta;
388  }
389  // Edge 6
390  else if ((i0[i] == 1) && (i1[i] == 1) && (i2[i] >=2 ))
391  {
392  if (elem->point(2) != std::min(elem->point(2), elem->point(6)))
393  zeta_mapped = -zeta;
394  }
395  // Edge 7
396  else if ((i0[i] == 0) && (i1[i] == 1) && (i2[i] >=2 ))
397  {
398  if (elem->point(3) != std::min(elem->point(3), elem->point(7)))
399  zeta_mapped = -zeta;
400  }
401  // Edge 8
402  else if ((i0[i] >=2 ) && (i1[i] == 0) && (i2[i] == 1))
403  {
404  if (elem->point(4) != std::min(elem->point(4), elem->point(5)))
405  xi_mapped = -xi;
406  }
407  // Edge 9
408  else if ((i0[i] == 1) && (i1[i] >=2 ) && (i2[i] == 1))
409  {
410  if (elem->point(5) != std::min(elem->point(5), elem->point(6)))
411  eta_mapped = -eta;
412  }
413  // Edge 10
414  else if ((i0[i] >=2 ) && (i1[i] == 1) && (i2[i] == 1))
415  {
416  if (elem->point(7) != std::min(elem->point(7), elem->point(6)))
417  xi_mapped = -xi;
418  }
419  // Edge 11
420  else if ((i0[i] == 0) && (i1[i] >=2 ) && (i2[i] == 1))
421  {
422  if (elem->point(4) != std::min(elem->point(4), elem->point(7)))
423  eta_mapped = -eta;
424  }
425  }
426 
427 
428  // handle the face orientation
429  {
430  // Face 0
431  if ( (i2[i] == 0) && (i0[i] >= 2) && (i1[i] >= 2))
432  {
433  const Point min_point = std::min(elem->point(1),
434  std::min(elem->point(2),
435  std::min(elem->point(0),
436  elem->point(3))));
437  if (elem->point(0) == min_point)
438  if (elem->point(1) == std::min(elem->point(1), elem->point(3)))
439  {
440  // Case 1
441  xi_mapped = xi;
442  eta_mapped = eta;
443  }
444  else
445  {
446  // Case 2
447  xi_mapped = eta;
448  eta_mapped = xi;
449  }
450 
451  else if (elem->point(3) == min_point)
452  if (elem->point(0) == std::min(elem->point(0), elem->point(2)))
453  {
454  // Case 3
455  xi_mapped = -eta;
456  eta_mapped = xi;
457  }
458  else
459  {
460  // Case 4
461  xi_mapped = xi;
462  eta_mapped = -eta;
463  }
464 
465  else if (elem->point(2) == min_point)
466  if (elem->point(3) == std::min(elem->point(3), elem->point(1)))
467  {
468  // Case 5
469  xi_mapped = -xi;
470  eta_mapped = -eta;
471  }
472  else
473  {
474  // Case 6
475  xi_mapped = -eta;
476  eta_mapped = -xi;
477  }
478 
479  else if (elem->point(1) == min_point)
480  {
481  if (elem->point(2) == std::min(elem->point(2), elem->point(0)))
482  {
483  // Case 7
484  xi_mapped = eta;
485  eta_mapped = -xi;
486  }
487  else
488  {
489  // Case 8
490  xi_mapped = -xi;
491  eta_mapped = eta;
492  }
493  }
494  }
495 
496 
497  // Face 1
498  else if ((i1[i] == 0) && (i0[i] >= 2) && (i2[i] >= 2))
499  {
500  const Point min_point = std::min(elem->point(0),
501  std::min(elem->point(1),
502  std::min(elem->point(5),
503  elem->point(4))));
504  if (elem->point(0) == min_point)
505  if (elem->point(1) == std::min(elem->point(1), elem->point(4)))
506  {
507  // Case 1
508  xi_mapped = xi;
509  zeta_mapped = zeta;
510  }
511  else
512  {
513  // Case 2
514  xi_mapped = zeta;
515  zeta_mapped = xi;
516  }
517 
518  else if (elem->point(1) == min_point)
519  if (elem->point(5) == std::min(elem->point(5), elem->point(0)))
520  {
521  // Case 3
522  xi_mapped = zeta;
523  zeta_mapped = -xi;
524  }
525  else
526  {
527  // Case 4
528  xi_mapped = -xi;
529  zeta_mapped = zeta;
530  }
531 
532  else if (elem->point(5) == min_point)
533  if (elem->point(4) == std::min(elem->point(4), elem->point(1)))
534  {
535  // Case 5
536  xi_mapped = -xi;
537  zeta_mapped = -zeta;
538  }
539  else
540  {
541  // Case 6
542  xi_mapped = -zeta;
543  zeta_mapped = -xi;
544  }
545 
546  else if (elem->point(4) == min_point)
547  {
548  if (elem->point(0) == std::min(elem->point(0), elem->point(5)))
549  {
550  // Case 7
551  xi_mapped = -xi;
552  zeta_mapped = zeta;
553  }
554  else
555  {
556  // Case 8
557  xi_mapped = xi;
558  zeta_mapped = -zeta;
559  }
560  }
561  }
562 
563 
564  // Face 2
565  else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] >= 2))
566  {
567  const Point min_point = std::min(elem->point(1),
568  std::min(elem->point(2),
569  std::min(elem->point(6),
570  elem->point(5))));
571  if (elem->point(1) == min_point)
572  if (elem->point(2) == std::min(elem->point(2), elem->point(5)))
573  {
574  // Case 1
575  eta_mapped = eta;
576  zeta_mapped = zeta;
577  }
578  else
579  {
580  // Case 2
581  eta_mapped = zeta;
582  zeta_mapped = eta;
583  }
584 
585  else if (elem->point(2) == min_point)
586  if (elem->point(6) == std::min(elem->point(6), elem->point(1)))
587  {
588  // Case 3
589  eta_mapped = zeta;
590  zeta_mapped = -eta;
591  }
592  else
593  {
594  // Case 4
595  eta_mapped = -eta;
596  zeta_mapped = zeta;
597  }
598 
599  else if (elem->point(6) == min_point)
600  if (elem->point(5) == std::min(elem->point(5), elem->point(2)))
601  {
602  // Case 5
603  eta_mapped = -eta;
604  zeta_mapped = -zeta;
605  }
606  else
607  {
608  // Case 6
609  eta_mapped = -zeta;
610  zeta_mapped = -eta;
611  }
612 
613  else if (elem->point(5) == min_point)
614  {
615  if (elem->point(1) == std::min(elem->point(1), elem->point(6)))
616  {
617  // Case 7
618  eta_mapped = -zeta;
619  zeta_mapped = eta;
620  }
621  else
622  {
623  // Case 8
624  eta_mapped = eta;
625  zeta_mapped = -zeta;
626  }
627  }
628  }
629 
630 
631  // Face 3
632  else if ((i1[i] == 1) && (i0[i] >= 2) && (i2[i] >= 2))
633  {
634  const Point min_point = std::min(elem->point(2),
635  std::min(elem->point(3),
636  std::min(elem->point(7),
637  elem->point(6))));
638  if (elem->point(3) == min_point)
639  if (elem->point(2) == std::min(elem->point(2), elem->point(7)))
640  {
641  // Case 1
642  xi_mapped = xi;
643  zeta_mapped = zeta;
644  }
645  else
646  {
647  // Case 2
648  xi_mapped = zeta;
649  zeta_mapped = xi;
650  }
651 
652  else if (elem->point(7) == min_point)
653  if (elem->point(3) == std::min(elem->point(3), elem->point(6)))
654  {
655  // Case 3
656  xi_mapped = -zeta;
657  zeta_mapped = xi;
658  }
659  else
660  {
661  // Case 4
662  xi_mapped = xi;
663  zeta_mapped = -zeta;
664  }
665 
666  else if (elem->point(6) == min_point)
667  if (elem->point(7) == std::min(elem->point(7), elem->point(2)))
668  {
669  // Case 5
670  xi_mapped = -xi;
671  zeta_mapped = -zeta;
672  }
673  else
674  {
675  // Case 6
676  xi_mapped = -zeta;
677  zeta_mapped = -xi;
678  }
679 
680  else if (elem->point(2) == min_point)
681  {
682  if (elem->point(6) == std::min(elem->point(3), elem->point(6)))
683  {
684  // Case 7
685  xi_mapped = zeta;
686  zeta_mapped = -xi;
687  }
688  else
689  {
690  // Case 8
691  xi_mapped = -xi;
692  zeta_mapped = zeta;
693  }
694  }
695  }
696 
697 
698  // Face 4
699  else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] >= 2))
700  {
701  const Point min_point = std::min(elem->point(3),
702  std::min(elem->point(0),
703  std::min(elem->point(4),
704  elem->point(7))));
705  if (elem->point(0) == min_point)
706  if (elem->point(3) == std::min(elem->point(3), elem->point(4)))
707  {
708  // Case 1
709  eta_mapped = eta;
710  zeta_mapped = zeta;
711  }
712  else
713  {
714  // Case 2
715  eta_mapped = zeta;
716  zeta_mapped = eta;
717  }
718 
719  else if (elem->point(4) == min_point)
720  if (elem->point(0) == std::min(elem->point(0), elem->point(7)))
721  {
722  // Case 3
723  eta_mapped = -zeta;
724  zeta_mapped = eta;
725  }
726  else
727  {
728  // Case 4
729  eta_mapped = eta;
730  zeta_mapped = -zeta;
731  }
732 
733  else if (elem->point(7) == min_point)
734  if (elem->point(4) == std::min(elem->point(4), elem->point(3)))
735  {
736  // Case 5
737  eta_mapped = -eta;
738  zeta_mapped = -zeta;
739  }
740  else
741  {
742  // Case 6
743  eta_mapped = -zeta;
744  zeta_mapped = -eta;
745  }
746 
747  else if (elem->point(3) == min_point)
748  {
749  if (elem->point(7) == std::min(elem->point(7), elem->point(0)))
750  {
751  // Case 7
752  eta_mapped = zeta;
753  zeta_mapped = -eta;
754  }
755  else
756  {
757  // Case 8
758  eta_mapped = -eta;
759  zeta_mapped = zeta;
760  }
761  }
762  }
763 
764 
765  // Face 5
766  else if ((i2[i] == 1) && (i0[i] >= 2) && (i1[i] >= 2))
767  {
768  const Point min_point = std::min(elem->point(4),
769  std::min(elem->point(5),
770  std::min(elem->point(6),
771  elem->point(7))));
772  if (elem->point(4) == min_point)
773  if (elem->point(5) == std::min(elem->point(5), elem->point(7)))
774  {
775  // Case 1
776  xi_mapped = xi;
777  eta_mapped = eta;
778  }
779  else
780  {
781  // Case 2
782  xi_mapped = eta;
783  eta_mapped = xi;
784  }
785 
786  else if (elem->point(5) == min_point)
787  if (elem->point(6) == std::min(elem->point(6), elem->point(4)))
788  {
789  // Case 3
790  xi_mapped = eta;
791  eta_mapped = -xi;
792  }
793  else
794  {
795  // Case 4
796  xi_mapped = -xi;
797  eta_mapped = eta;
798  }
799 
800  else if (elem->point(6) == min_point)
801  if (elem->point(7) == std::min(elem->point(7), elem->point(5)))
802  {
803  // Case 5
804  xi_mapped = -xi;
805  eta_mapped = -eta;
806  }
807  else
808  {
809  // Case 6
810  xi_mapped = -eta;
811  eta_mapped = -xi;
812  }
813 
814  else if (elem->point(7) == min_point)
815  {
816  if (elem->point(4) == std::min(elem->point(4), elem->point(6)))
817  {
818  // Case 7
819  xi_mapped = -eta;
820  eta_mapped = xi;
821  }
822  else
823  {
824  // Case 8
825  xi_mapped = xi;
826  eta_mapped = eta;
827  }
828  }
829  }
830  }
831 
832  return (FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[i], xi_mapped)*
833  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[i], eta_mapped)*
834  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[i], zeta_mapped));
835  }
836 
837 
838  default:
839  libmesh_error_msg("Invalid element type = " << type);
840  } //case HEX27
841 
842  }//case THIRD
843 
844 
845  // 4th-order Bernstein.
846  case FOURTH:
847  {
848  switch (type)
849  {
850 
851  // Bernstein shape functions on the hexahedral.
852  case HEX27:
853  {
854  libmesh_assert_less (i, 125);
855 
856  // Compute hex shape functions as a tensor-product
857  const Real xi = p(0);
858  const Real eta = p(1);
859  const Real zeta = p(2);
860  Real xi_mapped = p(0);
861  Real eta_mapped = p(1);
862  Real zeta_mapped = p(2);
863 
864  // The only way to make any sense of this
865  // is to look at the mgflo/mg2/mgf documentation
866  // and make the cut-out cube!
867  // Nodes 0 1 2 3 4 5 6 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 24 24 25 25 25 25 26 26 26 26 26 26 26 26
868  // DOFS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 18 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
869  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4};
870  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4};
871  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4};
872 
873 
874 
875  // handle the edge orientation
876  {
877  // Edge 0
878  if ( (i0[i] >= 2) && (i1[i] == 0) && (i2[i] == 0))
879  {
880  if (elem->point(0) != std::min(elem->point(0), elem->point(1)))
881  xi_mapped = -xi;
882  }
883  // Edge 1
884  else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] == 0))
885  {
886  if (elem->point(1) != std::min(elem->point(1), elem->point(2)))
887  eta_mapped = -eta;
888  }
889  // Edge 2
890  else if ((i0[i] >= 2) && (i1[i] == 1) && (i2[i] == 0))
891  {
892  if (elem->point(3) != std::min(elem->point(3), elem->point(2)))
893  xi_mapped = -xi;
894  }
895  // Edge 3
896  else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] == 0))
897  {
898  if (elem->point(0) != std::min(elem->point(0), elem->point(3)))
899  eta_mapped = -eta;
900  }
901  // Edge 4
902  else if ((i0[i] == 0) && (i1[i] == 0) && (i2[i] >=2 ))
903  {
904  if (elem->point(0) != std::min(elem->point(0), elem->point(4)))
905  zeta_mapped = -zeta;
906  }
907  // Edge 5
908  else if ((i0[i] == 1) && (i1[i] == 0) && (i2[i] >=2 ))
909  {
910  if (elem->point(1) != std::min(elem->point(1), elem->point(5)))
911  zeta_mapped = -zeta;
912  }
913  // Edge 6
914  else if ((i0[i] == 1) && (i1[i] == 1) && (i2[i] >=2 ))
915  {
916  if (elem->point(2) != std::min(elem->point(2), elem->point(6)))
917  zeta_mapped = -zeta;
918  }
919  // Edge 7
920  else if ((i0[i] == 0) && (i1[i] == 1) && (i2[i] >=2 ))
921  {
922  if (elem->point(3) != std::min(elem->point(3), elem->point(7)))
923  zeta_mapped = -zeta;
924  }
925  // Edge 8
926  else if ((i0[i] >=2 ) && (i1[i] == 0) && (i2[i] == 1))
927  {
928  if (elem->point(4) != std::min(elem->point(4), elem->point(5)))
929  xi_mapped = -xi;
930  }
931  // Edge 9
932  else if ((i0[i] == 1) && (i1[i] >=2 ) && (i2[i] == 1))
933  {
934  if (elem->point(5) != std::min(elem->point(5), elem->point(6)))
935  eta_mapped = -eta;
936  }
937  // Edge 10
938  else if ((i0[i] >=2 ) && (i1[i] == 1) && (i2[i] == 1))
939  {
940  if (elem->point(7) != std::min(elem->point(7), elem->point(6)))
941  xi_mapped = -xi;
942  }
943  // Edge 11
944  else if ((i0[i] == 0) && (i1[i] >=2 ) && (i2[i] == 1))
945  {
946  if (elem->point(4) != std::min(elem->point(4), elem->point(7)))
947  eta_mapped = -eta;
948  }
949  }
950 
951 
952  // handle the face orientation
953  {
954  // Face 0
955  if ( (i2[i] == 0) && (i0[i] >= 2) && (i1[i] >= 2))
956  {
957  const Point min_point = std::min(elem->point(1),
958  std::min(elem->point(2),
959  std::min(elem->point(0),
960  elem->point(3))));
961  if (elem->point(0) == min_point)
962  if (elem->point(1) == std::min(elem->point(1), elem->point(3)))
963  {
964  // Case 1
965  xi_mapped = xi;
966  eta_mapped = eta;
967  }
968  else
969  {
970  // Case 2
971  xi_mapped = eta;
972  eta_mapped = xi;
973  }
974 
975  else if (elem->point(3) == min_point)
976  if (elem->point(0) == std::min(elem->point(0), elem->point(2)))
977  {
978  // Case 3
979  xi_mapped = -eta;
980  eta_mapped = xi;
981  }
982  else
983  {
984  // Case 4
985  xi_mapped = xi;
986  eta_mapped = -eta;
987  }
988 
989  else if (elem->point(2) == min_point)
990  if (elem->point(3) == std::min(elem->point(3), elem->point(1)))
991  {
992  // Case 5
993  xi_mapped = -xi;
994  eta_mapped = -eta;
995  }
996  else
997  {
998  // Case 6
999  xi_mapped = -eta;
1000  eta_mapped = -xi;
1001  }
1002 
1003  else if (elem->point(1) == min_point)
1004  {
1005  if (elem->point(2) == std::min(elem->point(2), elem->point(0)))
1006  {
1007  // Case 7
1008  xi_mapped = eta;
1009  eta_mapped = -xi;
1010  }
1011  else
1012  {
1013  // Case 8
1014  xi_mapped = -xi;
1015  eta_mapped = eta;
1016  }
1017  }
1018  }
1019 
1020 
1021  // Face 1
1022  else if ((i1[i] == 0) && (i0[i] >= 2) && (i2[i] >= 2))
1023  {
1024  const Point min_point = std::min(elem->point(0),
1025  std::min(elem->point(1),
1026  std::min(elem->point(5),
1027  elem->point(4))));
1028  if (elem->point(0) == min_point)
1029  if (elem->point(1) == std::min(elem->point(1), elem->point(4)))
1030  {
1031  // Case 1
1032  xi_mapped = xi;
1033  zeta_mapped = zeta;
1034  }
1035  else
1036  {
1037  // Case 2
1038  xi_mapped = zeta;
1039  zeta_mapped = xi;
1040  }
1041 
1042  else if (elem->point(1) == min_point)
1043  if (elem->point(5) == std::min(elem->point(5), elem->point(0)))
1044  {
1045  // Case 3
1046  xi_mapped = zeta;
1047  zeta_mapped = -xi;
1048  }
1049  else
1050  {
1051  // Case 4
1052  xi_mapped = -xi;
1053  zeta_mapped = zeta;
1054  }
1055 
1056  else if (elem->point(5) == min_point)
1057  if (elem->point(4) == std::min(elem->point(4), elem->point(1)))
1058  {
1059  // Case 5
1060  xi_mapped = -xi;
1061  zeta_mapped = -zeta;
1062  }
1063  else
1064  {
1065  // Case 6
1066  xi_mapped = -zeta;
1067  zeta_mapped = -xi;
1068  }
1069 
1070  else if (elem->point(4) == min_point)
1071  {
1072  if (elem->point(0) == std::min(elem->point(0), elem->point(5)))
1073  {
1074  // Case 7
1075  xi_mapped = -xi;
1076  zeta_mapped = zeta;
1077  }
1078  else
1079  {
1080  // Case 8
1081  xi_mapped = xi;
1082  zeta_mapped = -zeta;
1083  }
1084  }
1085  }
1086 
1087 
1088  // Face 2
1089  else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] >= 2))
1090  {
1091  const Point min_point = std::min(elem->point(1),
1092  std::min(elem->point(2),
1093  std::min(elem->point(6),
1094  elem->point(5))));
1095  if (elem->point(1) == min_point)
1096  if (elem->point(2) == std::min(elem->point(2), elem->point(5)))
1097  {
1098  // Case 1
1099  eta_mapped = eta;
1100  zeta_mapped = zeta;
1101  }
1102  else
1103  {
1104  // Case 2
1105  eta_mapped = zeta;
1106  zeta_mapped = eta;
1107  }
1108 
1109  else if (elem->point(2) == min_point)
1110  if (elem->point(6) == std::min(elem->point(6), elem->point(1)))
1111  {
1112  // Case 3
1113  eta_mapped = zeta;
1114  zeta_mapped = -eta;
1115  }
1116  else
1117  {
1118  // Case 4
1119  eta_mapped = -eta;
1120  zeta_mapped = zeta;
1121  }
1122 
1123  else if (elem->point(6) == min_point)
1124  if (elem->point(5) == std::min(elem->point(5), elem->point(2)))
1125  {
1126  // Case 5
1127  eta_mapped = -eta;
1128  zeta_mapped = -zeta;
1129  }
1130  else
1131  {
1132  // Case 6
1133  eta_mapped = -zeta;
1134  zeta_mapped = -eta;
1135  }
1136 
1137  else if (elem->point(5) == min_point)
1138  {
1139  if (elem->point(1) == std::min(elem->point(1), elem->point(6)))
1140  {
1141  // Case 7
1142  eta_mapped = -zeta;
1143  zeta_mapped = eta;
1144  }
1145  else
1146  {
1147  // Case 8
1148  eta_mapped = eta;
1149  zeta_mapped = -zeta;
1150  }
1151  }
1152  }
1153 
1154 
1155  // Face 3
1156  else if ((i1[i] == 1) && (i0[i] >= 2) && (i2[i] >= 2))
1157  {
1158  const Point min_point = std::min(elem->point(2),
1159  std::min(elem->point(3),
1160  std::min(elem->point(7),
1161  elem->point(6))));
1162  if (elem->point(3) == min_point)
1163  if (elem->point(2) == std::min(elem->point(2), elem->point(7)))
1164  {
1165  // Case 1
1166  xi_mapped = xi;
1167  zeta_mapped = zeta;
1168  }
1169  else
1170  {
1171  // Case 2
1172  xi_mapped = zeta;
1173  zeta_mapped = xi;
1174  }
1175 
1176  else if (elem->point(7) == min_point)
1177  if (elem->point(3) == std::min(elem->point(3), elem->point(6)))
1178  {
1179  // Case 3
1180  xi_mapped = -zeta;
1181  zeta_mapped = xi;
1182  }
1183  else
1184  {
1185  // Case 4
1186  xi_mapped = xi;
1187  zeta_mapped = -zeta;
1188  }
1189 
1190  else if (elem->point(6) == min_point)
1191  if (elem->point(7) == std::min(elem->point(7), elem->point(2)))
1192  {
1193  // Case 5
1194  xi_mapped = -xi;
1195  zeta_mapped = -zeta;
1196  }
1197  else
1198  {
1199  // Case 6
1200  xi_mapped = -zeta;
1201  zeta_mapped = -xi;
1202  }
1203 
1204  else if (elem->point(2) == min_point)
1205  {
1206  if (elem->point(6) == std::min(elem->point(3), elem->point(6)))
1207  {
1208  // Case 7
1209  xi_mapped = zeta;
1210  zeta_mapped = -xi;
1211  }
1212  else
1213  {
1214  // Case 8
1215  xi_mapped = -xi;
1216  zeta_mapped = zeta;
1217  }
1218  }
1219  }
1220 
1221 
1222  // Face 4
1223  else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] >= 2))
1224  {
1225  const Point min_point = std::min(elem->point(3),
1226  std::min(elem->point(0),
1227  std::min(elem->point(4),
1228  elem->point(7))));
1229  if (elem->point(0) == min_point)
1230  if (elem->point(3) == std::min(elem->point(3), elem->point(4)))
1231  {
1232  // Case 1
1233  eta_mapped = eta;
1234  zeta_mapped = zeta;
1235  }
1236  else
1237  {
1238  // Case 2
1239  eta_mapped = zeta;
1240  zeta_mapped = eta;
1241  }
1242 
1243  else if (elem->point(4) == min_point)
1244  if (elem->point(0) == std::min(elem->point(0), elem->point(7)))
1245  {
1246  // Case 3
1247  eta_mapped = -zeta;
1248  zeta_mapped = eta;
1249  }
1250  else
1251  {
1252  // Case 4
1253  eta_mapped = eta;
1254  zeta_mapped = -zeta;
1255  }
1256 
1257  else if (elem->point(7) == min_point)
1258  if (elem->point(4) == std::min(elem->point(4), elem->point(3)))
1259  {
1260  // Case 5
1261  eta_mapped = -eta;
1262  zeta_mapped = -zeta;
1263  }
1264  else
1265  {
1266  // Case 6
1267  eta_mapped = -zeta;
1268  zeta_mapped = -eta;
1269  }
1270 
1271  else if (elem->point(3) == min_point)
1272  {
1273  if (elem->point(7) == std::min(elem->point(7), elem->point(0)))
1274  {
1275  // Case 7
1276  eta_mapped = zeta;
1277  zeta_mapped = -eta;
1278  }
1279  else
1280  {
1281  // Case 8
1282  eta_mapped = -eta;
1283  zeta_mapped = zeta;
1284  }
1285  }
1286  }
1287 
1288 
1289  // Face 5
1290  else if ((i2[i] == 1) && (i0[i] >= 2) && (i1[i] >= 2))
1291  {
1292  const Point min_point = std::min(elem->point(4),
1293  std::min(elem->point(5),
1294  std::min(elem->point(6),
1295  elem->point(7))));
1296  if (elem->point(4) == min_point)
1297  if (elem->point(5) == std::min(elem->point(5), elem->point(7)))
1298  {
1299  // Case 1
1300  xi_mapped = xi;
1301  eta_mapped = eta;
1302  }
1303  else
1304  {
1305  // Case 2
1306  xi_mapped = eta;
1307  eta_mapped = xi;
1308  }
1309 
1310  else if (elem->point(5) == min_point)
1311  if (elem->point(6) == std::min(elem->point(6), elem->point(4)))
1312  {
1313  // Case 3
1314  xi_mapped = eta;
1315  eta_mapped = -xi;
1316  }
1317  else
1318  {
1319  // Case 4
1320  xi_mapped = -xi;
1321  eta_mapped = eta;
1322  }
1323 
1324  else if (elem->point(6) == min_point)
1325  if (elem->point(7) == std::min(elem->point(7), elem->point(5)))
1326  {
1327  // Case 5
1328  xi_mapped = -xi;
1329  eta_mapped = -eta;
1330  }
1331  else
1332  {
1333  // Case 6
1334  xi_mapped = -eta;
1335  eta_mapped = -xi;
1336  }
1337 
1338  else if (elem->point(7) == min_point)
1339  {
1340  if (elem->point(4) == std::min(elem->point(4), elem->point(6)))
1341  {
1342  // Case 7
1343  xi_mapped = -eta;
1344  eta_mapped = xi;
1345  }
1346  else
1347  {
1348  // Case 8
1349  xi_mapped = xi;
1350  eta_mapped = eta;
1351  }
1352  }
1353  }
1354 
1355 
1356  }
1357 
1358 
1359  return (FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i0[i], xi_mapped)*
1360  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i1[i], eta_mapped)*
1361  FE<1,BERNSTEIN>::shape(EDGE3, totalorder, i2[i], zeta_mapped));
1362  }
1363 
1364 
1365  default:
1366  libmesh_error_msg("Invalid element type = " << type);
1367  }
1368  }
1369 
1370 
1371  default:
1372  libmesh_error_msg("Invalid totalorder = " << totalorder);
1373  }
1374 
1375 #endif
1376 
1377  libmesh_error_msg("We'll never get here!");
1378  return 0.;
1379 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
long double min(long double a, double b)
template<>
Real libMesh::FE< 2, SZABAB >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 53 of file fe_szabab_shape_2D.C.

57 {
58  libmesh_error_msg("Szabo-Babuska polynomials require the element type \nbecause edge orientation is needed.");
59  return 0.;
60 }
template<>
Real libMesh::FE< 2, SZABAB >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 65 of file fe_szabab_shape_2D.C.

References libMesh::EDGE3, libMesh::FIFTH, libMesh::FIRST, libMesh::FOURTH, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::Utility::pow(), libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::Real, libMesh::SECOND, libMesh::SEVENTH, libMesh::FE< Dim, T >::shape(), libMesh::SIXTH, libMesh::THIRD, libMesh::TRI3, libMesh::TRI6, libMesh::Elem::type(), and libMesh::x.

69 {
70  libmesh_assert(elem);
71 
72  const ElemType type = elem->type();
73 
74  const Order totalorder = static_cast<Order>(order + elem->p_level());
75 
76  // Declare that we are using our own special power function
77  // from the Utility namespace. This saves typing later.
78  using Utility::pow;
79 
80  switch (totalorder)
81  {
82  // 1st & 2nd-order Szabo-Babuska.
83  case FIRST:
84  case SECOND:
85  {
86  switch (type)
87  {
88 
89  // Szabo-Babuska shape functions on the triangle.
90  case TRI3:
91  case TRI6:
92  {
93  const Real l1 = 1-p(0)-p(1);
94  const Real l2 = p(0);
95  const Real l3 = p(1);
96 
97  libmesh_assert_less (i, 6);
98 
99  switch (i)
100  {
101  case 0: return l1;
102  case 1: return l2;
103  case 2: return l3;
104 
105  case 3: return l1*l2*(-4.*sqrt6);
106  case 4: return l2*l3*(-4.*sqrt6);
107  case 5: return l3*l1*(-4.*sqrt6);
108 
109  default:
110  libmesh_error_msg("Invalid i = " << i);
111  }
112  }
113 
114 
115  // Szabo-Babuska shape functions on the quadrilateral.
116  case QUAD4:
117  case QUAD8:
118  case QUAD9:
119  {
120  // Compute quad shape functions as a tensor-product
121  const Real xi = p(0);
122  const Real eta = p(1);
123 
124  libmesh_assert_less (i, 9);
125 
126  // 0 1 2 3 4 5 6 7 8
127  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
128  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
129 
130  return (FE<1,SZABAB>::shape(EDGE3, totalorder, i0[i], xi)*
131  FE<1,SZABAB>::shape(EDGE3, totalorder, i1[i], eta));
132 
133  }
134 
135  default:
136  libmesh_error_msg("Invalid element type = " << type);
137  }
138  }
139 
140 
141  // 3rd-order Szabo-Babuska.
142  case THIRD:
143  {
144  switch (type)
145  {
146 
147  // Szabo-Babuska shape functions on the triangle.
148  case TRI6:
149  {
150  Real l1 = 1-p(0)-p(1);
151  Real l2 = p(0);
152  Real l3 = p(1);
153 
154  Real f=1;
155 
156  libmesh_assert_less (i, 10);
157 
158 
159  if (i==4 && (elem->point(0) > elem->point(1)))f=-1;
160  if (i==6 && (elem->point(1) > elem->point(2)))f=-1;
161  if (i==8 && (elem->point(2) > elem->point(0)))f=-1;
162 
163 
164  switch (i)
165  {
166  //nodal modes
167  case 0: return l1;
168  case 1: return l2;
169  case 2: return l3;
170 
171  //side modes
172  case 3: return l1*l2*(-4.*sqrt6);
173  case 4: return f*l1*l2*(-4.*sqrt10)*(l2-l1);
174 
175  case 5: return l2*l3*(-4.*sqrt6);
176  case 6: return f*l2*l3*(-4.*sqrt10)*(l3-l2);
177 
178  case 7: return l3*l1*(-4.*sqrt6);
179  case 8: return f*l3*l1*(-4.*sqrt10)*(l1-l3);
180 
181  //internal modes
182  case 9: return l1*l2*l3;
183 
184  default:
185  libmesh_error_msg("Invalid i = " << i);
186  }
187  }
188 
189 
190  // Szabo-Babuska shape functions on the quadrilateral.
191  case QUAD8:
192  case QUAD9:
193  {
194  // Compute quad shape functions as a tensor-product
195  const Real xi = p(0);
196  const Real eta = p(1);
197 
198  libmesh_assert_less (i, 16);
199 
200  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
201  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 1, 1, 2, 3, 0, 0, 2, 3, 2, 3};
202  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 2, 2, 3, 3};
203 
204  Real f=1.;
205 
206  // take care of edge orientation, this is needed at
207  // edge shapes with (y=0)-asymmetric 1D shapes, these have
208  // one 1D shape index being 0 or 1, the other one being odd and >=3
209 
210  switch(i)
211  {
212  case 5: // edge 0 points
213  if (elem->point(0) > elem->point(1))f = -1.;
214  break;
215  case 7: // edge 1 points
216  if (elem->point(1) > elem->point(2))f = -1.;
217  break;
218  case 9: // edge 2 points
219  if (elem->point(3) > elem->point(2))f = -1.;
220  break;
221  case 11: // edge 3 points
222  if (elem->point(0) > elem->point(3))f = -1.;
223  break;
224 
225  default:
226  // Everything else keeps f=1
227  break;
228  }
229 
230  return f*(FE<1,SZABAB>::shape(EDGE3, totalorder, i0[i], xi)*
231  FE<1,SZABAB>::shape(EDGE3, totalorder, i1[i], eta));
232  }
233 
234  default:
235  libmesh_error_msg("Invalid element type = " << type);
236  }
237  }
238 
239 
240 
241 
242  // 4th-order Szabo-Babuska.
243  case FOURTH:
244  {
245  switch (type)
246  {
247  // Szabo-Babuska shape functions on the triangle.
248  case TRI6:
249  {
250  Real l1 = 1-p(0)-p(1);
251  Real l2 = p(0);
252  Real l3 = p(1);
253 
254  Real f=1;
255 
256  libmesh_assert_less (i, 15);
257 
258 
259  if (i== 4 && (elem->point(0) > elem->point(1)))f=-1;
260  if (i== 7 && (elem->point(1) > elem->point(2)))f=-1;
261  if (i==10 && (elem->point(2) > elem->point(0)))f=-1;
262 
263 
264  switch (i)
265  {
266  //nodal modes
267  case 0: return l1;
268  case 1: return l2;
269  case 2: return l3;
270 
271  //side modes
272  case 3: return l1*l2*(-4.*sqrt6);
273  case 4: return f*l1*l2*(-4.*sqrt10)*(l2-l1);
274  case 5: return l1*l2*(-sqrt14)*(5.*pow<2>(l2-l1)-1);
275 
276  case 6: return l2*l3*(-4.*sqrt6);
277  case 7: return f*l2*l3*(-4.*sqrt10)*(l3-l2);
278  case 8: return l2*l3*(-sqrt14)*(5.*pow<2>(l3-l2)-1);
279 
280  case 9: return l3*l1*(-4.*sqrt6);
281  case 10: return f*l3*l1*(-4.*sqrt10)*(l1-l3);
282  case 11: return l3*l1*(-sqrt14)*(5.*pow<2>(l1-l3)-1);
283 
284  //internal modes
285  case 12: return l1*l2*l3;
286 
287  case 13: return l1*l2*l3*(l2-l1);
288  case 14: return l1*l2*l3*(2*l3-1);
289 
290  default:
291  libmesh_error_msg("Invalid i = " << i);
292  }
293  }
294 
295 
296  // Szabo-Babuska shape functions on the quadrilateral.
297  case QUAD8:
298  case QUAD9:
299  {
300  // Compute quad shape functions as a tensor-product
301  const Real xi = p(0);
302  const Real eta = p(1);
303 
304  libmesh_assert_less (i, 25);
305 
306  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
307  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4};
308  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4};
309 
310  Real f=1.;
311 
312  switch(i)
313  {
314  case 5: // edge 0 points
315  if (elem->point(0) > elem->point(1))f = -1.;
316  break;
317  case 8: // edge 1 points
318  if (elem->point(1) > elem->point(2))f = -1.;
319  break;
320  case 11: // edge 2 points
321  if (elem->point(3) > elem->point(2))f = -1.;
322  break;
323  case 14: // edge 3 points
324  if (elem->point(0) > elem->point(3))f = -1.;
325  break;
326 
327  default:
328  // Everything else keeps f=1
329  break;
330  }
331 
332  return f*(FE<1,SZABAB>::shape(EDGE3, totalorder, i0[i], xi)*
333  FE<1,SZABAB>::shape(EDGE3, totalorder, i1[i], eta));
334  }
335 
336  default:
337  libmesh_error_msg("Invalid element type = " << type);
338  }
339  }
340 
341 
342 
343 
344  // 5th-order Szabo-Babuska.
345  case FIFTH:
346  {
347  switch (type)
348  {
349  // Szabo-Babuska shape functions on the triangle.
350  case TRI6:
351  {
352  Real l1 = 1-p(0)-p(1);
353  Real l2 = p(0);
354  Real l3 = p(1);
355 
356  const Real x=l2-l1;
357  const Real y=2.*l3-1;
358 
359  Real f=1;
360 
361  libmesh_assert_less (i, 21);
362 
363 
364  if ((i== 4||i== 6) && (elem->point(0) > elem->point(1)))f=-1;
365  if ((i== 8||i==10) && (elem->point(1) > elem->point(2)))f=-1;
366  if ((i==12||i==14) && (elem->point(2) > elem->point(0)))f=-1;
367 
368 
369  switch (i)
370  {
371  //nodal modes
372  case 0: return l1;
373  case 1: return l2;
374  case 2: return l3;
375 
376  //side modes
377  case 3: return l1*l2*(-4.*sqrt6);
378  case 4: return f*l1*l2*(-4.*sqrt10)*(l2-l1);
379  case 5: return -sqrt14*l1*l2*(5.0*l1*l1-1.0+(-10.0*l1+5.0*l2)*l2);
380  case 6: return f*(-sqrt2)*l1*l2*((9.-21.*l1*l1)*l1+(-9.+63.*l1*l1+(-63.*l1+21.*l2)*l2)*l2);
381 
382  case 7: return l2*l3*(-4.*sqrt6);
383  case 8: return f*l2*l3*(-4.*sqrt10)*(l3-l2);
384  case 9: return -sqrt14*l2*l3*(5.0*l3*l3-1.0+(-10.0*l3+5.0*l2)*l2);
385  case 10: return -f*sqrt2*l2*l3*((-9.0+21.0*l3*l3)*l3+(-63.0*l3*l3+9.0+(63.0*l3-21.0*l2)*l2)*l2);
386 
387  case 11: return l3*l1*(-4.*sqrt6);
388  case 12: return f*l3*l1*(-4.*sqrt10)*(l1-l3);
389  case 13: return -sqrt14*l3*l1*(5.0*l3*l3-1.0+(-10.0*l3+5.0*l1)*l1);
390  case 14: return f*(-sqrt2)*l3*l1*((9.0-21.0*l3*l3)*l3+(-9.0+63.0*l3*l3+(-63.0*l3+21.0*l1)*l1)*l1);
391 
392  //internal modes
393  case 15: return l1*l2*l3;
394 
395  case 16: return l1*l2*l3*x;
396  case 17: return l1*l2*l3*y;
397 
398  case 18: return l1*l2*l3*(1.5*l1*l1-.5+(-3.0*l1+1.5*l2)*l2);
399  case 19: return l1*l2*l3*x*y;
400  case 20: return l1*l2*l3*(1.0+(-6.0+6.0*l3)*l3);
401 
402  default:
403  libmesh_error_msg("Invalid i = " << i);
404  }
405  } // case TRI6
406 
407  // Szabo-Babuska shape functions on the quadrilateral.
408  case QUAD8:
409  case QUAD9:
410  {
411  // Compute quad shape functions as a tensor-product
412  const Real xi = p(0);
413  const Real eta = p(1);
414 
415  libmesh_assert_less (i, 36);
416 
417  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
418  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 0, 0, 0, 0, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5};
419  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5};
420 
421  Real f=1.;
422 
423  switch(i)
424  {
425  case 5: // edge 0 points
426  case 7:
427  if (elem->point(0) > elem->point(1))f = -1.;
428  break;
429  case 9: // edge 1 points
430  case 11:
431  if (elem->point(1) > elem->point(2))f = -1.;
432  break;
433  case 13: // edge 2 points
434  case 15:
435  if (elem->point(3) > elem->point(2))f = -1.;
436  break;
437  case 14: // edge 3 points
438  case 19:
439  if (elem->point(0) > elem->point(3))f = -1.;
440  break;
441 
442  default:
443  // Everything else keeps f=1
444  break;
445  }
446 
447  return f*(FE<1,SZABAB>::shape(EDGE3, totalorder, i0[i], xi)*
448  FE<1,SZABAB>::shape(EDGE3, totalorder, i1[i], eta));
449 
450  } // case QUAD8/QUAD9
451 
452  default:
453  libmesh_error_msg("Invalid element type = " << type);
454 
455  } // switch type
456 
457  } // case FIFTH
458 
459  // 6th-order Szabo-Babuska.
460  case SIXTH:
461  {
462  switch (type)
463  {
464  // Szabo-Babuska shape functions on the triangle.
465  case TRI6:
466  {
467  Real l1 = 1-p(0)-p(1);
468  Real l2 = p(0);
469  Real l3 = p(1);
470 
471  const Real x=l2-l1;
472  const Real y=2.*l3-1;
473 
474  Real f=1;
475 
476  libmesh_assert_less (i, 28);
477 
478 
479  if ((i== 4||i== 6) && (elem->point(0) > elem->point(1)))f=-1;
480  if ((i== 9||i==11) && (elem->point(1) > elem->point(2)))f=-1;
481  if ((i==14||i==16) && (elem->point(2) > elem->point(0)))f=-1;
482 
483 
484  switch (i)
485  {
486  //nodal modes
487  case 0: return l1;
488  case 1: return l2;
489  case 2: return l3;
490 
491  //side modes
492  case 3: return l1*l2*(-4.*sqrt6);
493  case 4: return f*l1*l2*(-4.*sqrt10)*(l2-l1);
494  case 5: return -sqrt14*l1*l2*(5.0*l1*l1-1.0+(-10.0*l1+5.0*l2)*l2);
495  case 6: return f*(-sqrt2)*l1*l2*((9.0-21.0*l1*l1)*l1+(-9.0+63.0*l1*l1+(-63.0*l1+21.0*l2)*l2)*l2);
496  case 7: return -sqrt22*l1*l2*(0.5+(-7.0+0.105E2*l1*l1)*l1*l1+((14.0-0.42E2*l1*l1)*l1+(-7.0+0.63E2*l1*l1+(-0.42E2*l1+0.105E2*l2)*l2)*l2)*l2);
497 
498  case 8: return l2*l3*(-4.*sqrt6);
499  case 9: return f*l2*l3*(-4.*sqrt10)*(l3-l2);
500  case 10: return -sqrt14*l2*l3*(5.0*l3*l3-1.0+(-10.0*l3+5.0*l2)*l2);
501  case 11: return f*(-sqrt2)*l2*l3*((-9.0+21.0*l3*l3)*l3+(-63.0*l3*l3+9.0+(63.0*l3-21.0*l2)*l2)*l2);
502  case 12: return -sqrt22*l2*l3*(0.5+(-7.0+0.105E2*l3*l3)*l3*l3+((14.0-0.42E2*l3*l3)*l3+(-7.0+0.63E2*l3*l3+(-0.42E2*l3+0.105E2*l2)*l2)*l2)*l2);
503 
504  case 13: return l3*l1*(-4.*sqrt6);
505  case 14: return f*l3*l1*(-4.*sqrt10)*(l1-l3);
506  case 15: return -sqrt14*l3*l1*(5.0*l3*l3-1.0+(-10.0*l3+5.0*l1)*l1);
507  case 16: return f*(-sqrt2)*l3*l1*((9.0-21.0*l3*l3)*l3+(-9.0+63.0*l3*l3+(-63.0*l3+21.0*l1)*l1)*l1);
508  case 17: return -sqrt22*l3*l1*(0.5+(-7.0+0.105E2*l3*l3)*l3*l3+((14.0-0.42E2*l3*l3)*l3+(-7.0+0.63E2*l3*l3+(-0.42E2*l3+0.105E2*l1)*l1)*l1)*l1);
509 
510 
511 
512  //internal modes
513  case 18: return l1*l2*l3;
514 
515  case 19: return l1*l2*l3*x;
516  case 20: return l1*l2*l3*y;
517 
518  case 21: return 0.5*l1*l2*l3*(3.0*l1*l1-1.0+(-6.0*l1+3.0*l2)*l2);
519  case 22: return l1*l2*l3*(l2-l1)*(2.0*l3-1.0);
520  case 23: return 0.5*l1*l2*l3*(2.0+(-12.0+12.0*l3)*l3);
521  case 24: return 0.5*l1*l2*l3*((3.0-5.0*l1*l1)*l1+(-3.0+15.0*l1*l1+(-15.0*l1+5.0*l2)*l2)*l2);
522  case 25: return 0.5*l1*l2*l3*(3.0*l1*l1-1.0+(-6.0*l1+3.0*l2)*l2)*(2.0*l3-1.0);
523  case 26: return 0.5*l1*l2*l3*(2.0+(-12.0+12.0*l3)*l3)*(l2-l1);
524  case 27: return 0.5*l1*l2*l3*(-2.0+(24.0+(-60.0+40.0*l3)*l3)*l3);
525 
526 
527  default:
528  libmesh_error_msg("Invalid i = " << i);
529  }
530  } // case TRI6
531 
532  // Szabo-Babuska shape functions on the quadrilateral.
533  case QUAD8:
534  case QUAD9:
535  {
536  // Compute quad shape functions as a tensor-product
537  const Real xi = p(0);
538  const Real eta = p(1);
539 
540  libmesh_assert_less (i, 49);
541 
542  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
543  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6};
544  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6};
545 
546  Real f=1.;
547 
548  switch(i)
549  {
550  case 5: // edge 0 points
551  case 7:
552  if (elem->point(0) > elem->point(1))f = -1.;
553  break;
554  case 10: // edge 1 points
555  case 12:
556  if (elem->point(1) > elem->point(2))f = -1.;
557  break;
558  case 15: // edge 2 points
559  case 17:
560  if (elem->point(3) > elem->point(2))f = -1.;
561  break;
562  case 20: // edge 3 points
563  case 22:
564  if (elem->point(0) > elem->point(3))f = -1.;
565  break;
566 
567  default:
568  // Everything else keeps f=1
569  break;
570  }
571 
572  return f*(FE<1,SZABAB>::shape(EDGE3, totalorder, i0[i], xi)*
573  FE<1,SZABAB>::shape(EDGE3, totalorder, i1[i], eta));
574 
575  } // case QUAD8/QUAD9
576 
577  default:
578  libmesh_error_msg("Invalid element type = " << type);
579 
580  } // switch type
581 
582  } // case SIXTH
583 
584 
585  // 7th-order Szabo-Babuska.
586  case SEVENTH:
587  {
588  switch (type)
589  {
590  // Szabo-Babuska shape functions on the triangle.
591  case TRI6:
592  {
593 
594  Real l1 = 1-p(0)-p(1);
595  Real l2 = p(0);
596  Real l3 = p(1);
597 
598  const Real x=l2-l1;
599  const Real y=2.*l3-1.;
600 
601  Real f=1;
602 
603  libmesh_assert_less (i, 36);
604 
605 
606  if ((i>= 4&&i<= 8) && (elem->point(0) > elem->point(1)))f=-1;
607  if ((i>=10&&i<=14) && (elem->point(1) > elem->point(2)))f=-1;
608  if ((i>=16&&i<=20) && (elem->point(2) > elem->point(0)))f=-1;
609 
610 
611  switch (i)
612  {
613  //nodal modes
614  case 0: return l1;
615  case 1: return l2;
616  case 2: return l3;
617 
618  //side modes
619  case 3: return l1*l2*(-4.*sqrt6);
620  case 4: return f*l1*l2*(-4.*sqrt10)*(l2-l1);
621 
622  case 5: return -sqrt14*l1*l2*(5.0*l1*l1-1.0+(-10.0*l1+5.0*l2)*l2);
623  case 6: return f*-sqrt2*l1*l2*((9.0-21.0*l1*l1)*l1+(-9.0+63.0*l1*l1+(-63.0*l1+21.0*l2)*l2)*l2);
624  case 7: return -sqrt22*l1*l2*(0.5+(-7.0+0.105E2*l1*l1)*l1*l1+((14.0-0.42E2*l1*l1)*l1+(-7.0+0.63E2*l1*l1+(-0.42E2*l1+0.105E2*l2)*l2)*l2)*l2);
625  case 8: return f*-sqrt26*l1*l2*((-0.25E1+(15.0-0.165E2*l1*l1)*l1*l1)*l1+(0.25E1+(-45.0+0.825E2*l1*l1)*l1*l1+((45.0-0.165E3*l1*l1)*l1+(-15.0+0.165E3*l1*l1+(-0.825E2*l1+0.165E2*l2)*l2)*l2)*l2)*l2);
626 
627  case 9: return l2*l3*(-4.*sqrt6);
628  case 10: return f*l2*l3*(-4.*sqrt10)*(l3-l2);
629 
630  case 11: return -sqrt14*l2*l3*(5.0*l3*l3-1.0+(-10.0*l3+5.0*l2)*l2);
631  case 12: return f*-sqrt2*l2*l3*((-9.0+21.0*l3*l3)*l3+(-63.0*l3*l3+9.0+(63.0*l3-21.0*l2)*l2)*l2);
632  case 13: return -sqrt22*l2*l3*(0.5+(-7.0+0.105E2*l3*l3)*l3*l3+((14.0-0.42E2*l3*l3)*l3+(-7.0+0.63E2*l3*l3+(-0.42E2*l3+0.105E2*l2)*l2)*l2)*l2);
633  case 14: return f*-sqrt26*l2*l3*((0.25E1+(-15.0+0.165E2*l3*l3)*l3*l3)*l3+(-0.25E1+(45.0-0.825E2*l3*l3)*l3*l3+((-45.0+0.165E3*l3*l3)*l3+(15.0-0.165E3*l3*l3+(0.825E2*l3-0.165E2*l2)*l2)*l2)*l2)*l2);
634 
635  case 15: return l3*l1*(-4.*sqrt6);
636  case 16: return f*l3*l1*(-4.*sqrt10)*(l1-l3);
637 
638  case 17: return -sqrt14*l3*l1*(5.0*l3*l3-1.0+(-10.0*l3+5.0*l1)*l1);
639  case 18: return -f*sqrt2*l3*l1*((9.-21.*l3*l3)*l3+(-9.+63.*l3*l3+(-63.*l3+21.*l1)*l1)*l1);
640  case 19: return -sqrt22*l3*l1*(0.5+(-7.0+0.105E2*l3*l3)*l3*l3+((14.0-0.42E2*l3*l3)*l3+(-7.0+0.63E2*l3*l3+(-0.42E2*l3+0.105E2*l1)*l1)*l1)*l1);
641  case 20: return f*-sqrt26*l3*l1*((-0.25E1+(15.0-0.165E2*l3*l3)*l3*l3)*l3+(0.25E1+(-45.0+0.825E2*l3*l3)*l3*l3+((45.0-0.165E3*l3*l3)*l3+(-15.0+0.165E3*l3*l3+(-0.825E2*l3+0.165E2*l1)*l1)*l1)*l1)*l1);
642 
643 
644  //internal modes
645  case 21: return l1*l2*l3;
646 
647  case 22: return l1*l2*l3*x;
648  case 23: return l1*l2*l3*y;
649 
650  case 24: return l1*l2*l3*0.5*(3.*pow<2>(x)-1.);
651  case 25: return l1*l2*l3*x*y;
652  case 26: return l1*l2*l3*0.5*(3.*pow<2>(y)-1.);
653 
654  case 27: return 0.5*l1*l2*l3*((3.0-5.0*l1*l1)*l1+(-3.0+15.0*l1*l1+(-15.0*l1+5.0*l2)*l2)*l2);
655  case 28: return 0.5*l1*l2*l3*(3.0*l1*l1-1.0+(-6.0*l1+3.0*l2)*l2)*(2.0*l3-1.0);
656  case 29: return 0.5*l1*l2*l3*(2.0+(-12.0+12.0*l3)*l3)*(l2-l1);
657  case 30: return 0.5*l1*l2*l3*(-2.0+(24.0+(-60.0+40.0*l3)*l3)*l3);
658  case 31: return 0.125*l1*l2*l3*((-15.0+(70.0-63.0*l1*l1)*l1*l1)*l1+(15.0+(-210.0+315.0*l1*l1)*l1*l1+((210.0-630.0*l1*l1)*l1+(-70.0+630.0*l1*l1+(-315.0*l1+63.0*l2)*l2)*l2)*l2)*l2);
659  case 32: return 0.5*l1*l2*l3*((3.0-5.0*l1*l1)*l1+(-3.0+15.0*l1*l1+(-15.0*l1+5.0*l2)*l2)*l2)*(2.0*l3-1.0);
660  case 33: return 0.25*l1*l2*l3*(3.0*l1*l1-1.0+(-6.0*l1+3.0*l2)*l2)*(2.0+(-12.0+12.0*l3)*l3);
661  case 34: return 0.5*l1*l2*l3*(-2.0+(24.0+(-60.0+40.0*l3)*l3)*l3)*(l2-l1);
662  case 35: return 0.125*l1*l2*l3*(-8.0+(240.0+(-1680.0+(4480.0+(-5040.0+2016.0*l3)*l3)*l3)*l3)*l3);
663 
664  default:
665  libmesh_error_msg("Invalid i = " << i);
666  }
667  } // case TRI6
668 
669  // Szabo-Babuska shape functions on the quadrilateral.
670  case QUAD8:
671  case QUAD9:
672  {
673  // Compute quad shape functions as a tensor-product
674  const Real xi = p(0);
675  const Real eta = p(1);
676 
677  libmesh_assert_less (i, 64);
678 
679  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
680  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 6, 7, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7};
681  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7};
682 
683  Real f=1.;
684 
685  switch(i)
686  {
687  case 5: // edge 0 points
688  case 7:
689  case 9:
690  if (elem->point(0) > elem->point(1))f = -1.;
691  break;
692  case 11: // edge 1 points
693  case 13:
694  case 15:
695  if (elem->point(1) > elem->point(2))f = -1.;
696  break;
697  case 17: // edge 2 points
698  case 19:
699  case 21:
700  if (elem->point(3) > elem->point(2))f = -1.;
701  break;
702  case 23: // edge 3 points
703  case 25:
704  case 27:
705  if (elem->point(0) > elem->point(3))f = -1.;
706  break;
707 
708  default:
709  // Everything else keeps f=1
710  break;
711  }
712 
713  return f*(FE<1,SZABAB>::shape(EDGE3, totalorder, i0[i], xi)*
714  FE<1,SZABAB>::shape(EDGE3, totalorder, i1[i], eta));
715 
716  } // case QUAD8/QUAD9
717 
718  default:
719  libmesh_error_msg("Invalid element type = " << type);
720 
721  } // switch type
722 
723  } // case SEVENTH
724 
725 
726  // by default throw an error
727  default:
728  libmesh_error_msg("ERROR: Unsupported polynomial order!");
729  } // switch order
730 
731  libmesh_error_msg("We'll never get here!");
732  return 0.;
733 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
T pow(const T &x)
Definition: utility.h:194
PetscErrorCode Vec x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, MONOMIAL >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 73 of file fe_monomial_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

77 {
78  libmesh_assert(elem);
79 
80  return FE<1,MONOMIAL>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
81 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
template<>
Real libMesh::FE< 1, SZABAB >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 82 of file fe_szabab_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

86 {
87  libmesh_assert(elem);
88 
89  return FE<1,SZABAB>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
90 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
template<>
Real libMesh::FE< 1, L2_HIERARCHIC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 101 of file fe_l2_hierarchic_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

105 {
106  libmesh_assert(elem);
107 
108  return FE<1,L2_HIERARCHIC>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
109 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
template<>
Real libMesh::FE< 1, HIERARCHIC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 101 of file fe_hierarchic_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

105 {
106  libmesh_assert(elem);
107 
108  return FE<1,HIERARCHIC>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
109 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
template<unsigned int Dim, FEFamily T>
static OutputShape libMesh::FE< Dim, T >::shape ( const ElemType  t,
const Order  o,
const unsigned int  i,
const Point p 
)
static
Returns
the value of the $ i^{th} $ shape function at point p. This method allows you to specify the imension, element type, and order directly. This allows the method to be static.

On a p-refined element, o should be the total order of the element.

Referenced by libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), libMesh::FEXYZ< Dim >::compute_face_values(), libMesh::FEMap::init_edge_shape_functions(), libMesh::FEMap::init_face_shape_functions(), libMesh::FEMap::init_reference_to_physical_map(), libMesh::FESubdivision::init_shape_functions(), libMesh::FE< Dim, T >::map(), libMesh::FE< Dim, T >::shape(), and libMesh::FE< Dim, T >::shape_deriv().

template<>
Real libMesh::FE< 2, MONOMIAL >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 119 of file fe_monomial_shape_2D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

123 {
124  libmesh_assert(elem);
125 
126  // by default call the orientation-independent shape functions
127  return FE<2,MONOMIAL>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
128 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
template<>
Real libMesh::FE< 1, L2_LAGRANGE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 120 of file fe_l2_lagrange_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

124 {
125  libmesh_assert(elem);
126 
127  return FE<1,L2_LAGRANGE>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
128 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
template<>
Real libMesh::FE< 1, LAGRANGE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 120 of file fe_lagrange_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

124 {
125  libmesh_assert(elem);
126 
127  return FE<1,LAGRANGE>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
128 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
template<unsigned int Dim, FEFamily T>
static OutputShape libMesh::FE< Dim, T >::shape ( const Elem elem,
const Order  o,
const unsigned int  i,
const Point p 
)
static
Returns
the value of the $ i^{th} $ shape function at point p. This method allows you to specify the imension, element type, and order directly. This allows the method to be static.

On a p-refined element, o should be the base order of the element.

template<>
Real libMesh::FE< 1, HERMITE >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 184 of file fe_hermite_shape_1D.C.

188 {
189  libmesh_error_msg("Hermite elements require the real element \nto construct gradient-based degrees of freedom.");
190  return 0.;
191 }
template<>
Real libMesh::FE< 3, MONOMIAL >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 187 of file fe_monomial_shape_3D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

191 {
192  libmesh_assert(elem);
193 
194  // call the orientation-independent shape functions
195  return FE<3,MONOMIAL>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
196 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
template<>
Real libMesh::FE< 2, HERMITE >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 189 of file fe_hermite_shape_2D.C.

193 {
194  libmesh_error_msg("Hermite elements require the real element \nto construct gradient-based degrees of freedom.");
195  return 0.;
196 }
template<>
Real libMesh::FE< 1, BERNSTEIN >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 192 of file fe_bernstein_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

196 {
197  libmesh_assert(elem);
198 
199  return FE<1,BERNSTEIN>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
200 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
template<>
Real libMesh::FE< 1, HERMITE >::shape ( const Elem elem,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const Point p 
)

Definition at line 196 of file fe_hermite_shape_1D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::FEHermite< Dim >::hermite_raw_shape(), libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Real, and libMesh::Elem::type().

200 {
201  libmesh_assert(elem);
202 
203  // Coefficient naming: d(1)d(2n) is the coefficient of the
204  // global shape function corresponding to value 1 in terms of the
205  // local shape function corresponding to normal derivative 2
206  Real d1xd1x, d2xd2x;
207 
208  hermite_compute_coefs(elem, d1xd1x, d2xd2x);
209 
210  const ElemType type = elem->type();
211 
212 #ifndef NDEBUG
213  const unsigned int totalorder = order + elem->p_level();
214 #endif
215 
216  switch (type)
217  {
218  // C1 functions on the C1 cubic edge
219  case EDGE2:
220  case EDGE3:
221  {
222  libmesh_assert_less (i, totalorder+1);
223 
224  switch (i)
225  {
226  case 0:
227  return FEHermite<1>::hermite_raw_shape(0, p(0));
228  case 1:
229  return d1xd1x * FEHermite<1>::hermite_raw_shape(2, p(0));
230  case 2:
231  return FEHermite<1>::hermite_raw_shape(1, p(0));
232  case 3:
233  return d2xd2x * FEHermite<1>::hermite_raw_shape(3, p(0));
234  default:
235  return FEHermite<1>::hermite_raw_shape(i, p(0));
236  }
237  }
238  default:
239  libmesh_error_msg("ERROR: Unsupported element type = " << type);
240  }
241 
242  libmesh_error_msg("We'll never get here!");
243  return 0.;
244 }
libmesh_assert(remote_elem)
unsigned int p_level() const
Definition: elem.h:2141
static Real hermite_raw_shape(const unsigned int basis_num, const Real xi)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ElemType type() const =0
template<>
Real libMesh::FE< 2, HERMITE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 201 of file fe_hermite_shape_2D.C.

References libMesh::FEHermite< Dim >::hermite_raw_shape(), libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::Real, and libMesh::Elem::type().

205 {
206  libmesh_assert(elem);
207 
208  std::vector<std::vector<Real> > dxdxi(2, std::vector<Real>(2, 0));
209 
210 #ifdef DEBUG
211  std::vector<Real> dxdeta(2), dydxi(2);
212 #endif
213 
214  hermite_compute_coefs(elem,dxdxi
215 #ifdef DEBUG
216  ,dxdeta,dydxi
217 #endif
218  );
219 
220  const ElemType type = elem->type();
221 
222  const Order totalorder = static_cast<Order>(order + elem->p_level());
223 
224  switch (type)
225  {
226  case QUAD4:
227  case QUADSHELL4:
228  libmesh_assert_less (totalorder, 4);
229  case QUAD8:
230  case QUAD9:
231  {
232  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
233 
234  std::vector<unsigned int> bases1D;
235 
236  Real coef = hermite_bases_2D(bases1D, dxdxi, totalorder, i);
237 
238  return coef * FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
239  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1));
240  }
241  default:
242  libmesh_error_msg("ERROR: Unsupported element type = " << type);
243  }
244 
245  libmesh_error_msg("We'll never get here!");
246  return 0.;
247 }
libmesh_assert(remote_elem)
unsigned int p_level() const
Definition: elem.h:2141
static Real hermite_raw_shape(const unsigned int basis_num, const Real xi)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ElemType type() const =0
template<>
Real libMesh::FE< 2, LAGRANGE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 209 of file fe_lagrange_shape_2D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

213 {
214  libmesh_assert(elem);
215 
216  // call the orientation-independent shape functions
217  return FE<2,LAGRANGE>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
218 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
template<>
Real libMesh::FE< 2, L2_LAGRANGE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 210 of file fe_l2_lagrange_shape_2D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

214 {
215  libmesh_assert(elem);
216 
217  // call the orientation-independent shape functions
218  return FE<2,L2_LAGRANGE>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
219 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
template<>
Real libMesh::FE< 1, CLOUGH >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 213 of file fe_clough_shape_1D.C.

217 {
218  libmesh_error_msg("Clough-Tocher elements require the real element \nto construct gradient-based degrees of freedom.");
219  return 0.;
220 }
template<>
Real libMesh::FE< 1, CLOUGH >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 225 of file fe_clough_shape_1D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::THIRD, and libMesh::Elem::type().

229 {
230  libmesh_assert(elem);
231 
232  clough_compute_coefs(elem);
233 
234  const ElemType type = elem->type();
235 
236  const Order totalorder = static_cast<Order>(order + elem->p_level());
237 
238  switch (totalorder)
239  {
240  // 3rd-order C1 cubic element
241  case THIRD:
242  {
243  switch (type)
244  {
245  // C1 functions on the C1 cubic edge
246  case EDGE2:
247  case EDGE3:
248  {
249  libmesh_assert_less (i, 4);
250 
251  switch (i)
252  {
253  case 0:
254  return clough_raw_shape(0, p);
255  case 1:
256  return clough_raw_shape(1, p);
257  case 2:
258  return d1xd1x * clough_raw_shape(2, p);
259  case 3:
260  return d2xd2x * clough_raw_shape(3, p);
261  default:
262  libmesh_error_msg("Invalid shape function index i = " << i);
263  }
264  }
265  default:
266  libmesh_error_msg("ERROR: Unsupported element type = " << type);
267  }
268  }
269  // by default throw an error
270  default:
271  libmesh_error_msg("ERROR: Unsupported polynomial order = " << totalorder);
272  }
273 
274  libmesh_error_msg("We'll never get here!");
275  return 0.;
276 }
libmesh_assert(remote_elem)
unsigned int p_level() const
Definition: elem.h:2141
virtual ElemType type() const =0
template<>
Real libMesh::FE< 3, L2_LAGRANGE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 359 of file fe_l2_lagrange_shape_3D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

363 {
364  libmesh_assert(elem);
365 
366  // call the orientation-independent shape functions
367  return FE<3,L2_LAGRANGE>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
368 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
template<>
Real libMesh::FE< 3, HERMITE >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 376 of file fe_hermite_shape_3D.C.

380 {
381  libmesh_error_msg("Hermite elements require the real element \nto construct gradient-based degrees of freedom.");
382  return 0.;
383 }
template<>
Real libMesh::FE< 3, HERMITE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 388 of file fe_hermite_shape_3D.C.

References libMesh::FEHermite< Dim >::hermite_raw_shape(), libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Real, libMesh::THIRD, and libMesh::Elem::type().

392 {
393  libmesh_assert(elem);
394 
395  std::vector<std::vector<Real> > dxdxi(3, std::vector<Real>(2, 0));
396 
397 #ifdef DEBUG
398  std::vector<Real> dydxi(2), dzdeta(2), dxdzeta(2);
399  std::vector<Real> dzdxi(2), dxdeta(2), dydzeta(2);
400 #endif //DEBUG
401 
402  hermite_compute_coefs(elem, dxdxi
403 #ifdef DEBUG
404  , dydxi, dzdeta, dxdzeta, dzdxi, dxdeta, dydzeta
405 #endif
406  );
407 
408  const ElemType type = elem->type();
409 
410  const Order totalorder = static_cast<Order>(order + elem->p_level());
411 
412  switch (totalorder)
413  {
414  // 3rd-order tricubic Hermite functions
415  case THIRD:
416  {
417  switch (type)
418  {
419  case HEX8:
420  case HEX20:
421  case HEX27:
422  {
423  libmesh_assert_less (i, 64);
424 
425  std::vector<unsigned int> bases1D;
426 
427  Real coef = hermite_bases_3D(bases1D, dxdxi, totalorder, i);
428 
429  return coef *
430  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
431  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1)) *
432  FEHermite<1>::hermite_raw_shape(bases1D[2],p(2));
433  }
434  default:
435  libmesh_error_msg("ERROR: Unsupported element type " << type);
436  }
437  }
438  // by default throw an error
439  default:
440  libmesh_error_msg("ERROR: Unsupported polynomial order " << totalorder);
441  }
442 
443  libmesh_error_msg("We'll never get here!");
444  return 0.;
445 }
libmesh_assert(remote_elem)
unsigned int p_level() const
Definition: elem.h:2141
static Real hermite_raw_shape(const unsigned int basis_num, const Real xi)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ElemType type() const =0
template<>
RealGradient libMesh::FE< 0, LAGRANGE_VEC >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 538 of file fe_lagrange_vec.C.

References libMesh::Real, and libMesh::FE< Dim, T >::shape().

540 {
541  Real value = FE<0,LAGRANGE>::shape( type, order, i, p );
542  return libMesh::RealGradient( value );
543 }
RealVectorValue RealGradient
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, SUBDIVISION >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Subdivision finite elements.

Template specialization prototypes are needed for calling from inside FESubdivision::init_shape_functions

template<>
Real libMesh::FE< 3, LAGRANGE >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 559 of file fe_lagrange_shape_3D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

563 {
564  libmesh_assert(elem);
565 
566  // call the orientation-independent shape functions
567  return FE<3,LAGRANGE>::shape(elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
568 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
template<>
RealGradient libMesh::FE< 1, LAGRANGE_VEC >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 560 of file fe_lagrange_vec.C.

References libMesh::Real, and libMesh::FE< Dim, T >::shape().

562 {
563  Real value = FE<1,LAGRANGE>::shape( type, order, i, p );
564  return libMesh::RealGradient( value );
565 }
RealVectorValue RealGradient
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
RealGradient libMesh::FE< 2, LAGRANGE_VEC >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 582 of file fe_lagrange_vec.C.

References libMesh::Real, and libMesh::FE< Dim, T >::shape().

584 {
585  Real value = FE<2,LAGRANGE>::shape( type, order, i/2, p );
586 
587  switch( i%2 )
588  {
589  case 0:
590  return libMesh::RealGradient( value );
591 
592  case 1:
593  return libMesh::RealGradient( Real(0), value );
594 
595  default:
596  libmesh_error_msg("i%2 must be either 0 or 1!");
597  }
598 
599  //dummy
600  return libMesh::RealGradient();
601 }
RealVectorValue RealGradient
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
RealGradient libMesh::FE< 0, NEDELEC_ONE >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 599 of file fe_nedelec_one.C.

600 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
RealGradient libMesh::FE< 0, NEDELEC_ONE >::shape ( const Elem ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 602 of file fe_nedelec_one.C.

603 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
RealGradient libMesh::FE< 1, NEDELEC_ONE >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 622 of file fe_nedelec_one.C.

623 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
RealGradient libMesh::FE< 1, NEDELEC_ONE >::shape ( const Elem ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 625 of file fe_nedelec_one.C.

626 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
Real libMesh::FE< 3, L2_HIERARCHIC >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 645 of file fe_l2_hierarchic_shape_3D.C.

649 {
650  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge and face orientation is needed.");
651  return 0.;
652 }
template<>
Real libMesh::FE< 3, HIERARCHIC >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 645 of file fe_hierarchic_shape_3D.C.

649 {
650  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge and face orientation is needed.");
651  return 0.;
652 }
template<>
RealGradient libMesh::FE< 3, LAGRANGE_VEC >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 647 of file fe_lagrange_vec.C.

References libMesh::Real, and libMesh::FE< Dim, T >::shape().

649 {
650  Real value = FE<3,LAGRANGE>::shape( type, order, i/3, p );
651 
652  switch( i%3 )
653  {
654  case 0:
655  return libMesh::RealGradient( value );
656 
657  case 1:
658  return libMesh::RealGradient( Real(0), value );
659 
660  case 2:
661  return libMesh::RealGradient( Real(0), Real(0), value );
662 
663  default:
664  libmesh_error_msg("i%3 must be 0, 1, or 2!");
665  }
666 
667  //dummy
668  return libMesh::RealGradient();
669 }
RealVectorValue RealGradient
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, L2_HIERARCHIC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 657 of file fe_l2_hierarchic_shape_3D.C.

References libMesh::EDGE3, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Real, and libMesh::Elem::type().

661 {
662 #if LIBMESH_DIM == 3
663 
664  libmesh_assert(elem);
665  const ElemType type = elem->type();
666 
667  const Order totalorder = static_cast<Order>(order+elem->p_level());
668 
669  switch (type)
670  {
671  case HEX8:
672  case HEX20:
673  libmesh_assert_less (totalorder, 2);
674  case HEX27:
675  {
676  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u)*(totalorder+1u));
677 
678  // Compute hex shape functions as a tensor-product
679  Real xi = p(0);
680  Real eta = p(1);
681  Real zeta = p(2);
682 
683  unsigned int i0, i1, i2;
684 
685  cube_indices(elem, totalorder, i, xi, eta, zeta, i0, i1, i2);
686 
687  return (FE<1,L2_HIERARCHIC>::shape(EDGE3, totalorder, i0, xi)*
688  FE<1,L2_HIERARCHIC>::shape(EDGE3, totalorder, i1, eta)*
689  FE<1,L2_HIERARCHIC>::shape(EDGE3, totalorder, i2, zeta));
690  }
691 
692  default:
693  libmesh_error_msg("Invalid element type = " << type);
694  }
695 
696 #endif
697 
698  libmesh_error_msg("We'll never get here!");
699  return 0.;
700 }
libmesh_assert(remote_elem)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, HIERARCHIC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 657 of file fe_hierarchic_shape_3D.C.

References libMesh::EDGE3, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Real, and libMesh::Elem::type().

661 {
662 #if LIBMESH_DIM == 3
663 
664  libmesh_assert(elem);
665  const ElemType type = elem->type();
666 
667  const Order totalorder = static_cast<Order>(order+elem->p_level());
668 
669  switch (type)
670  {
671  case HEX8:
672  case HEX20:
673  libmesh_assert_less (totalorder, 2);
674  case HEX27:
675  {
676  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u)*(totalorder+1u));
677 
678  // Compute hex shape functions as a tensor-product
679  Real xi = p(0);
680  Real eta = p(1);
681  Real zeta = p(2);
682 
683  unsigned int i0, i1, i2;
684 
685  cube_indices(elem, totalorder, i, xi, eta, zeta, i0, i1, i2);
686 
687  return (FE<1,HIERARCHIC>::shape(EDGE3, totalorder, i0, xi)*
688  FE<1,HIERARCHIC>::shape(EDGE3, totalorder, i1, eta)*
689  FE<1,HIERARCHIC>::shape(EDGE3, totalorder, i2, zeta));
690  }
691 
692  default:
693  libmesh_error_msg("Invalid element type = " << type);
694  }
695 
696 #endif
697 
698  libmesh_error_msg("We'll never get here!");
699  return 0.;
700 }
libmesh_assert(remote_elem)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, SUBDIVISION >::shape ( const ElemType  type,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 709 of file fe_subdivision_2D.C.

References libMesh::FOURTH, and libMesh::TRI3SUBDIVISION.

713 {
714  switch (order)
715  {
716  case FOURTH:
717  {
718  switch (type)
719  {
720  case TRI3SUBDIVISION:
721  libmesh_assert_less(i, 12);
722  return FESubdivision::regular_shape(i,p(0),p(1));
723  default:
724  libmesh_error_msg("ERROR: Unsupported element type!");
725  }
726  }
727  default:
728  libmesh_error_msg("ERROR: Unsupported polynomial order!");
729  }
730 
731  libmesh_error_msg("We'll never get here!");
732  return 0.;
733 }
static Real regular_shape(const unsigned int i, const Real v, const Real w)
template<>
RealGradient libMesh::FE< 0, LAGRANGE_VEC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 722 of file fe_lagrange_vec.C.

References libMesh::Elem::p_level(), libMesh::Real, libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

724 {
725  Real value = FE<0,LAGRANGE>::shape( elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
726  return libMesh::RealGradient( value );
727 }
RealVectorValue RealGradient
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, SUBDIVISION >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 738 of file fe_subdivision_2D.C.

References libMesh::libmesh_assert(), and libMesh::Elem::type().

742 {
743  libmesh_assert(elem);
744  return FE<2,SUBDIVISION>::shape(elem->type(), order, i, p);
745 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
template<>
RealGradient libMesh::FE< 1, LAGRANGE_VEC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 744 of file fe_lagrange_vec.C.

References libMesh::Elem::p_level(), libMesh::Real, libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

746 {
747  Real value = FE<1,LAGRANGE>::shape( elem->type(), static_cast<Order>(order + elem->p_level()), i, p);
748  return libMesh::RealGradient( value );
749 }
RealVectorValue RealGradient
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
RealGradient libMesh::FE< 2, LAGRANGE_VEC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 766 of file fe_lagrange_vec.C.

References libMesh::Elem::p_level(), libMesh::Real, libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

768 {
769  Real value = FE<2,LAGRANGE>::shape( elem->type(), static_cast<Order>(order + elem->p_level()), i/2, p );
770 
771  switch( i%2 )
772  {
773  case 0:
774  return libMesh::RealGradient( value );
775 
776  case 1:
777  return libMesh::RealGradient( Real(0), value );
778 
779  default:
780  libmesh_error_msg("i%2 must be either 0 or 1!");
781  }
782 
783  //dummy
784  return libMesh::RealGradient();
785 }
RealVectorValue RealGradient
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
RealGradient libMesh::FE< 3, LAGRANGE_VEC >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 830 of file fe_lagrange_vec.C.

References libMesh::Elem::p_level(), libMesh::Real, libMesh::FE< Dim, T >::shape(), and libMesh::Elem::type().

832 {
833  Real value = FE<3,LAGRANGE>::shape( elem->type(), static_cast<Order>(order + elem->p_level()), i/3, p );
834 
835  switch( i%3 )
836  {
837  case 0:
838  return libMesh::RealGradient( value );
839 
840  case 1:
841  return libMesh::RealGradient( Real(0), value );
842 
843  case 2:
844  return libMesh::RealGradient( Real(0), Real(0), value );
845 
846  default:
847  libmesh_error_msg("i%3 must be 0, 1, or 2!");
848  }
849 
850  //dummy
851  return libMesh::RealGradient();
852 }
RealVectorValue RealGradient
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, CLOUGH >::shape ( const ElemType  ,
const Order  ,
const unsigned  int,
const Point  
)

Definition at line 1803 of file fe_clough_shape_2D.C.

1807 {
1808  libmesh_error_msg("Clough-Tocher elements require the real element \nto construct gradient-based degrees of freedom.");
1809  return 0.;
1810 }
template<>
Real libMesh::FE< 2, CLOUGH >::shape ( const Elem elem,
const Order  order,
const unsigned int  i,
const Point p 
)

Definition at line 1815 of file fe_clough_shape_2D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::SECOND, libMesh::THIRD, libMesh::TRI6, and libMesh::Elem::type().

1819 {
1820  libmesh_assert(elem);
1821 
1822  clough_compute_coefs(elem);
1823 
1824  const ElemType type = elem->type();
1825 
1826  const Order totalorder = static_cast<Order>(order + elem->p_level());
1827 
1828  switch (totalorder)
1829  {
1830  // 2nd-order restricted Clough-Tocher element
1831  case SECOND:
1832  {
1833  // There may be a bug in the 2nd order case; the 3rd order
1834  // Clough-Tocher elements are pretty uniformly better anyways
1835  // so use those instead.
1836  libmesh_experimental();
1837  switch (type)
1838  {
1839  // C1 functions on the Clough-Tocher triangle.
1840  case TRI6:
1841  {
1842  libmesh_assert_less (i, 9);
1843  // FIXME: it would be nice to calculate (and cache)
1844  // clough_raw_shape(j,p) only once per triangle, not 1-7
1845  // times
1846  switch (i)
1847  {
1848  // Note: these DoF numbers are "scrambled" because my
1849  // initial numbering conventions didn't match libMesh
1850  case 0:
1851  return clough_raw_shape(0, p)
1852  + d1d2n * clough_raw_shape(10, p)
1853  + d1d3n * clough_raw_shape(11, p);
1854  case 3:
1855  return clough_raw_shape(1, p)
1856  + d2d3n * clough_raw_shape(11, p)
1857  + d2d1n * clough_raw_shape(9, p);
1858  case 6:
1859  return clough_raw_shape(2, p)
1860  + d3d1n * clough_raw_shape(9, p)
1861  + d3d2n * clough_raw_shape(10, p);
1862  case 1:
1863  return d1xd1x * clough_raw_shape(3, p)
1864  + d1xd1y * clough_raw_shape(4, p)
1865  + d1xd2n * clough_raw_shape(10, p)
1866  + d1xd3n * clough_raw_shape(11, p)
1867  + 0.5 * N01x * d3nd3n * clough_raw_shape(11, p)
1868  + 0.5 * N02x * d2nd2n * clough_raw_shape(10, p);
1869  case 2:
1870  return d1yd1y * clough_raw_shape(4, p)
1871  + d1yd1x * clough_raw_shape(3, p)
1872  + d1yd2n * clough_raw_shape(10, p)
1873  + d1yd3n * clough_raw_shape(11, p)
1874  + 0.5 * N01y * d3nd3n * clough_raw_shape(11, p)
1875  + 0.5 * N02y * d2nd2n * clough_raw_shape(10, p);
1876  case 4:
1877  return d2xd2x * clough_raw_shape(5, p)
1878  + d2xd2y * clough_raw_shape(6, p)
1879  + d2xd3n * clough_raw_shape(11, p)
1880  + d2xd1n * clough_raw_shape(9, p)
1881  + 0.5 * N10x * d3nd3n * clough_raw_shape(11, p)
1882  + 0.5 * N12x * d1nd1n * clough_raw_shape(9, p);
1883  case 5:
1884  return d2yd2y * clough_raw_shape(6, p)
1885  + d2yd2x * clough_raw_shape(5, p)
1886  + d2yd3n * clough_raw_shape(11, p)
1887  + d2yd1n * clough_raw_shape(9, p)
1888  + 0.5 * N10y * d3nd3n * clough_raw_shape(11, p)
1889  + 0.5 * N12y * d1nd1n * clough_raw_shape(9, p);
1890  case 7:
1891  return d3xd3x * clough_raw_shape(7, p)
1892  + d3xd3y * clough_raw_shape(8, p)
1893  + d3xd1n * clough_raw_shape(9, p)
1894  + d3xd2n * clough_raw_shape(10, p)
1895  + 0.5 * N20x * d2nd2n * clough_raw_shape(10, p)
1896  + 0.5 * N21x * d1nd1n * clough_raw_shape(9, p);
1897  case 8:
1898  return d3yd3y * clough_raw_shape(8, p)
1899  + d3yd3x * clough_raw_shape(7, p)
1900  + d3yd1n * clough_raw_shape(9, p)
1901  + d3yd2n * clough_raw_shape(10, p)
1902  + 0.5 * N20y * d2nd2n * clough_raw_shape(10, p)
1903  + 0.5 * N21y * d1nd1n * clough_raw_shape(9, p);
1904  default:
1905  libmesh_error_msg("Invalid shape function index i = " << i);
1906  }
1907  }
1908  default:
1909  libmesh_error_msg("ERROR: Unsupported element type = " << type);
1910  }
1911  }
1912  // 3rd-order Clough-Tocher element
1913  case THIRD:
1914  {
1915  switch (type)
1916  {
1917  // C1 functions on the Clough-Tocher triangle.
1918  case TRI6:
1919  {
1920  libmesh_assert_less (i, 12);
1921 
1922  // FIXME: it would be nice to calculate (and cache)
1923  // clough_raw_shape(j,p) only once per triangle, not 1-7
1924  // times
1925  switch (i)
1926  {
1927  // Note: these DoF numbers are "scrambled" because my
1928  // initial numbering conventions didn't match libMesh
1929  case 0:
1930  return clough_raw_shape(0, p)
1931  + d1d2n * clough_raw_shape(10, p)
1932  + d1d3n * clough_raw_shape(11, p);
1933  case 3:
1934  return clough_raw_shape(1, p)
1935  + d2d3n * clough_raw_shape(11, p)
1936  + d2d1n * clough_raw_shape(9, p);
1937  case 6:
1938  return clough_raw_shape(2, p)
1939  + d3d1n * clough_raw_shape(9, p)
1940  + d3d2n * clough_raw_shape(10, p);
1941  case 1:
1942  return d1xd1x * clough_raw_shape(3, p)
1943  + d1xd1y * clough_raw_shape(4, p)
1944  + d1xd2n * clough_raw_shape(10, p)
1945  + d1xd3n * clough_raw_shape(11, p);
1946  case 2:
1947  return d1yd1y * clough_raw_shape(4, p)
1948  + d1yd1x * clough_raw_shape(3, p)
1949  + d1yd2n * clough_raw_shape(10, p)
1950  + d1yd3n * clough_raw_shape(11, p);
1951  case 4:
1952  return d2xd2x * clough_raw_shape(5, p)
1953  + d2xd2y * clough_raw_shape(6, p)
1954  + d2xd3n * clough_raw_shape(11, p)
1955  + d2xd1n * clough_raw_shape(9, p);
1956  case 5:
1957  return d2yd2y * clough_raw_shape(6, p)
1958  + d2yd2x * clough_raw_shape(5, p)
1959  + d2yd3n * clough_raw_shape(11, p)
1960  + d2yd1n * clough_raw_shape(9, p);
1961  case 7:
1962  return d3xd3x * clough_raw_shape(7, p)
1963  + d3xd3y * clough_raw_shape(8, p)
1964  + d3xd1n * clough_raw_shape(9, p)
1965  + d3xd2n * clough_raw_shape(10, p);
1966  case 8:
1967  return d3yd3y * clough_raw_shape(8, p)
1968  + d3yd3x * clough_raw_shape(7, p)
1969  + d3yd1n * clough_raw_shape(9, p)
1970  + d3yd2n * clough_raw_shape(10, p);
1971  case 10:
1972  return d1nd1n * clough_raw_shape(9, p);
1973  case 11:
1974  return d2nd2n * clough_raw_shape(10, p);
1975  case 9:
1976  return d3nd3n * clough_raw_shape(11, p);
1977 
1978  default:
1979  libmesh_error_msg("Invalid shape function index i = " << i);
1980  }
1981  }
1982  default:
1983  libmesh_error_msg("ERROR: Unsupported element type = " << type);
1984  }
1985  }
1986  // by default throw an error
1987  default:
1988  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
1989  }
1990 
1991  libmesh_error_msg("We'll never get here!");
1992  return 0.;
1993 }
libmesh_assert(remote_elem)
unsigned int p_level() const
Definition: elem.h:2141
virtual ElemType type() const =0
template<>
Real libMesh::FE< 1, SCALAR >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 47 of file fe_scalar_shape_1D.C.

52 {
53  return 0.;
54 }
template<>
Real libMesh::FE< 0, SCALAR >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 47 of file fe_scalar_shape_0D.C.

52 {
53  return 0.;
54 }
template<>
Real libMesh::FE< 3, SCALAR >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 47 of file fe_scalar_shape_3D.C.

52 {
53  return 0.;
54 }
template<>
Real libMesh::FE< 2, SCALAR >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 48 of file fe_scalar_shape_2D.C.

53 {
54  return 0.;
55 }
template<>
Real libMesh::FE< 3, SZABAB >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 55 of file fe_szabab_shape_3D.C.

60 {
61  libmesh_error_msg("Szabo-Babuska polynomials are not defined in 3D");
62  return 0.;
63 }
template<>
Real libMesh::FE< 0, BERNSTEIN >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 56 of file fe_bernstein_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }
template<>
Real libMesh::FE< 0, MONOMIAL >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 56 of file fe_monomial_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }
template<>
Real libMesh::FE< 0, SZABAB >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 56 of file fe_szabab_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }
template<>
Real libMesh::FE< 0, HERMITE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 56 of file fe_hermite_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }
template<>
Real libMesh::FE< 0, XYZ >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 56 of file fe_xyz_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }
template<>
Real libMesh::FE< 0, LAGRANGE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 56 of file fe_lagrange_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }
template<>
Real libMesh::FE< 0, L2_LAGRANGE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 56 of file fe_l2_lagrange_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }
template<>
Real libMesh::FE< 0, HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 56 of file fe_hierarchic_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }
template<>
Real libMesh::FE< 0, CLOUGH >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 56 of file fe_clough_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }
template<>
Real libMesh::FE< 0, L2_HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 56 of file fe_l2_hierarchic_shape_0D.C.

61 {
62  libmesh_error_msg("No spatial derivatives in 0D!");
63  return 0.;
64 }
template<>
Real libMesh::FE< 0, SCALAR >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 57 of file fe_scalar_shape_0D.C.

62 {
63  return 0.;
64 }
template<>
Real libMesh::FE< 1, SCALAR >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 57 of file fe_scalar_shape_1D.C.

62 {
63  return 0.;
64 }
template<>
Real libMesh::FE< 3, SCALAR >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 57 of file fe_scalar_shape_3D.C.

62 {
63  return 0.;
64 }
template<>
Real libMesh::FE< 2, SCALAR >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 58 of file fe_scalar_shape_2D.C.

63 {
64  return 0.;
65 }
template<>
Real libMesh::FE< 3, CLOUGH >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 59 of file fe_clough_shape_3D.C.

64 {
65  libmesh_error_msg("Clough-Tocher elements require the real element \nto construct gradient-based degrees of freedom.");
66  return 0.;
67 }
template<>
Real libMesh::FE< 3, SZABAB >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 68 of file fe_szabab_shape_3D.C.

73 {
74  libmesh_error_msg("Szabo-Babuska polynomials are not defined in 3D");
75  return 0.;
76 }
template<>
Real libMesh::FE< 0, L2_HIERARCHIC >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 69 of file fe_l2_hierarchic_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }
template<>
Real libMesh::FE< 0, BERNSTEIN >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 69 of file fe_bernstein_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }
template<>
Real libMesh::FE< 0, L2_LAGRANGE >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 69 of file fe_l2_lagrange_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }
template<>
Real libMesh::FE< 0, XYZ >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 69 of file fe_xyz_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }
template<>
Real libMesh::FE< 0, LAGRANGE >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 69 of file fe_lagrange_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }
template<>
Real libMesh::FE< 0, SZABAB >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 69 of file fe_szabab_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }
template<>
Real libMesh::FE< 0, HIERARCHIC >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 69 of file fe_hierarchic_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }
template<>
Real libMesh::FE< 0, HERMITE >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 69 of file fe_hermite_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }
template<>
Real libMesh::FE< 0, CLOUGH >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 69 of file fe_clough_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }
template<>
Real libMesh::FE< 0, MONOMIAL >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 69 of file fe_monomial_shape_0D.C.

74 {
75  libmesh_error_msg("No spatial derivatives in 0D!");
76  return 0.;
77 }
template<>
Real libMesh::FE< 3, CLOUGH >::shape_deriv ( const Elem libmesh_dbg_varelem,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 72 of file fe_clough_shape_3D.C.

References libMesh::libmesh_assert().

77 {
78  libmesh_assert(elem);
79  libmesh_not_implemented();
80  return 0.;
81 }
libmesh_assert(remote_elem)
template<>
Real libMesh::FE< 1, MONOMIAL >::shape_deriv ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int   libmesh_dbg_varj,
const Point p 
)

Definition at line 86 of file fe_monomial_shape_1D.C.

References libMesh::Real.

91 {
92  // only d()/dxi in 1D!
93 
94  libmesh_assert_equal_to (j, 0);
95 
96  const Real xi = p(0);
97 
98  libmesh_assert_less_equal (i, static_cast<unsigned int>(order));
99 
100  // monomials. since they are hierarchic we only need one case block.
101  switch (i)
102  {
103  case 0:
104  return 0.;
105 
106  case 1:
107  return 1.;
108 
109  case 2:
110  return 2.*xi;
111 
112  case 3:
113  return 3.*xi*xi;
114 
115  case 4:
116  return 4.*xi*xi*xi;
117 
118  default:
119  Real val = i;
120  for (unsigned int index = 1; index != i; ++index)
121  val *= xi;
122  return val;
123  }
124 
125  libmesh_error_msg("We'll never get here!");
126  return 0.;
127 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, SZABAB >::shape_deriv ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int   libmesh_dbg_varj,
const Point p 
)

Definition at line 95 of file fe_szabab_shape_1D.C.

References libMesh::Real, and libMesh::SEVENTH.

100 {
101  // only d()/dxi in 1D!
102  libmesh_assert_equal_to (j, 0);
103 
104  const Real xi = p(0);
105  const Real xi2 = xi*xi;
106 
107  // Use this libmesh_assert rather than a switch with a single entry...
108  // It will go away in optimized mode, essentially has the same effect.
109  libmesh_assert_less_equal (order, SEVENTH);
110 
111  // switch (order)
112  // {
113  // case FIRST:
114  // case SECOND:
115  // case THIRD:
116  // case FOURTH:
117  // case FIFTH:
118  // case SIXTH:
119  // case SEVENTH:
120 
121  switch(i)
122  {
123  case 0:return -1./2.;
124  case 1:return 1./2.;
125  case 2:return 1./2.*2.4494897427831780982*xi;
126  case 3:return -1./4.*3.1622776601683793320+3./4.*3.1622776601683793320*xi2;
127  case 4:return 1./16.*3.7416573867739413856*(-12.+20*xi2)*xi;
128  case 5:return 9./16.*1.4142135623730950488+(-45./8.*1.4142135623730950488+105./16.*1.4142135623730950488*xi2)*xi2;
129  case 6:return 1./32.*4.6904157598234295546*(30.+(-140.+126.*xi2)*xi2)*xi;
130  case 7:return -5./32.*5.0990195135927848300+(105./32.*5.0990195135927848300+(-315./32.*5.0990195135927848300+231./32.*5.0990195135927848300*xi2)*xi2)*xi2;
131  case 8:return 1./256.*5.4772255750516611346*(-280.+(2520.+(-5544.+3432.*xi2)*xi2)*xi2)*xi;
132 
133  default:
134  libmesh_error_msg("Invalid shape function index!");
135  }
136 
137  libmesh_error_msg("We'll never get here!");
138  return 0.;
139 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, XYZ >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 97 of file fe_xyz_shape_1D.C.

102 {
103  libmesh_error_msg("XYZ polynomials require the element \nbecause the centroid is needed.");
104  return 0.;
105 }
template<>
Real libMesh::FE< 1, XYZ >::shape_deriv ( const Elem elem,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int   libmesh_dbg_varj,
const Point point_in 
)

Definition at line 110 of file fe_xyz_shape_1D.C.

References std::abs(), libMesh::Elem::centroid(), libMesh::libmesh_assert(), std::max(), libMesh::Elem::n_nodes(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::Real, and libMesh::x.

115 {
116  libmesh_assert(elem);
117  libmesh_assert_less_equal (i, order + elem->p_level());
118 
119  // only d()/dxi in 1D!
120 
121  libmesh_assert_equal_to (j, 0);
122 
123  Point centroid = elem->centroid();
124  Real max_distance = 0.;
125  for (unsigned int p = 0; p < elem->n_nodes(); p++)
126  {
127  const Real distance = std::abs(centroid(0) - elem->point(p)(0));
128  max_distance = std::max(distance, max_distance);
129  }
130 
131  const Real x = point_in(0);
132  const Real xc = centroid(0);
133  const Real dx = (x - xc)/max_distance;
134 
135  // monomials. since they are hierarchic we only need one case block.
136  switch (i)
137  {
138  case 0:
139  return 0.;
140 
141  case 1:
142  return 1.;
143 
144  case 2:
145  return 2.*dx/max_distance;
146 
147  case 3:
148  return 3.*dx*dx/max_distance;
149 
150  case 4:
151  return 4.*dx*dx*dx/max_distance;
152 
153  default:
154  Real val = i;
155  for (unsigned int index = 1; index != i; ++index)
156  val *= dx;
157  return val/max_distance;
158  }
159 
160  libmesh_error_msg("We'll never get here!");
161  return 0.;
162 }
double abs(double a)
libmesh_assert(remote_elem)
long double max(long double a, double b)
PetscErrorCode Vec x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, L2_HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int   libmesh_dbg_varj,
const Point p 
)

Definition at line 114 of file fe_l2_hierarchic_shape_1D.C.

References libMesh::Utility::pow(), and libMesh::Real.

119 {
120  // only d()/dxi in 1D!
121 
122  libmesh_assert_equal_to (j, 0);
123  libmesh_assert_less (i, order+1u);
124 
125  // Declare that we are using our own special power function
126  // from the Utility namespace. This saves typing later.
127  using Utility::pow;
128 
129  const Real xi = p(0);
130 
131  Real returnval = 1.;
132 
133  switch (i)
134  {
135  case 0:
136  returnval = -.5;
137  break;
138  case 1:
139  returnval = .5;
140  break;
141  // All even-terms have the same form.
142  // xi^(p-1)/(p-1)!
143  case 2:
144  returnval = xi;
145  break;
146  case 4:
147  returnval = pow<3>(xi)/6.;
148  break;
149  case 6:
150  returnval = pow<5>(xi)/120.;
151  break;
152  // All odd-terms have the same form.
153  // (p*xi^(p-1) - 1.)/p!
154  case 3:
155  returnval = (3*xi*xi - 1.)/6.;
156  break;
157  case 5:
158  returnval = (5.*pow<4>(xi) - 1.)/120.;
159  break;
160  case 7:
161  returnval = (7.*pow<6>(xi) - 1.)/5040.;
162  break;
163  default:
164  Real denominator = 1.;
165  for (unsigned int n=1; n != i; ++n)
166  {
167  returnval *= xi;
168  denominator *= n;
169  }
170  // Odd:
171  if (i % 2)
172  returnval = (i * returnval - 1.)/denominator/i;
173  // Even:
174  else
175  returnval = returnval/denominator;
176  break;
177  }
178 
179  return returnval;
180 }
T pow(const T &x)
Definition: utility.h:194
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int   libmesh_dbg_varj,
const Point p 
)

Definition at line 114 of file fe_hierarchic_shape_1D.C.

References libMesh::Utility::pow(), and libMesh::Real.

119 {
120  // only d()/dxi in 1D!
121 
122  libmesh_assert_equal_to (j, 0);
123  libmesh_assert_less (i, order+1u);
124 
125  // Declare that we are using our own special power function
126  // from the Utility namespace. This saves typing later.
127  using Utility::pow;
128 
129  const Real xi = p(0);
130 
131  Real returnval = 1.;
132 
133  switch (i)
134  {
135  case 0:
136  returnval = -.5;
137  break;
138  case 1:
139  returnval = .5;
140  break;
141  // All even-terms have the same form.
142  // xi^(p-1)/(p-1)!
143  case 2:
144  returnval = xi;
145  break;
146  case 4:
147  returnval = pow<3>(xi)/6.;
148  break;
149  case 6:
150  returnval = pow<5>(xi)/120.;
151  break;
152  // All odd-terms have the same form.
153  // (p*xi^(p-1) - 1.)/p!
154  case 3:
155  returnval = (3*xi*xi - 1.)/6.;
156  break;
157  case 5:
158  returnval = (5.*pow<4>(xi) - 1.)/120.;
159  break;
160  case 7:
161  returnval = (7.*pow<6>(xi) - 1.)/5040.;
162  break;
163  default:
164  Real denominator = 1.;
165  for (unsigned int n=1; n != i; ++n)
166  {
167  returnval *= xi;
168  denominator *= n;
169  }
170  // Odd:
171  if (i % 2)
172  returnval = (i * returnval - 1.)/denominator/i;
173  // Even:
174  else
175  returnval = returnval/denominator;
176  break;
177  }
178 
179  return returnval;
180 }
T pow(const T &x)
Definition: utility.h:194
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, MONOMIAL >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 132 of file fe_monomial_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

137 {
138  libmesh_assert(elem);
139 
140  return FE<1,MONOMIAL>::shape_deriv(elem->type(),
141  static_cast<Order>(order + elem->p_level()), i, j, p);
142 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 2, MONOMIAL >::shape_deriv ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 133 of file fe_monomial_shape_2D.C.

References libMesh::Real.

138 {
139 #if LIBMESH_DIM > 1
140 
141 
142  libmesh_assert_less (j, 2);
143 
144  libmesh_assert_less (i, (static_cast<unsigned int>(order)+1)*
145  (static_cast<unsigned int>(order)+2)/2);
146 
147  const Real xi = p(0);
148  const Real eta = p(1);
149 
150  // monomials. since they are hierarchic we only need one case block.
151 
152  switch (j)
153  {
154  // d()/dxi
155  case 0:
156  {
157  switch (i)
158  {
159  // constants
160  case 0:
161  return 0.;
162 
163  // linears
164  case 1:
165  return 1.;
166 
167  case 2:
168  return 0.;
169 
170  // quadratics
171  case 3:
172  return 2.*xi;
173 
174  case 4:
175  return eta;
176 
177  case 5:
178  return 0.;
179 
180  // cubics
181  case 6:
182  return 3.*xi*xi;
183 
184  case 7:
185  return 2.*xi*eta;
186 
187  case 8:
188  return eta*eta;
189 
190  case 9:
191  return 0.;
192 
193  // quartics
194  case 10:
195  return 4.*xi*xi*xi;
196 
197  case 11:
198  return 3.*xi*xi*eta;
199 
200  case 12:
201  return 2.*xi*eta*eta;
202 
203  case 13:
204  return eta*eta*eta;
205 
206  case 14:
207  return 0.;
208 
209  default:
210  unsigned int o = 0;
211  for (; i >= (o+1)*(o+2)/2; o++) { }
212  unsigned int ny = i - (o*(o+1)/2);
213  unsigned int nx = o - ny;
214  Real val = nx;
215  for (unsigned int index=1; index < nx; index++)
216  val *= xi;
217  for (unsigned int index=0; index != ny; index++)
218  val *= eta;
219  return val;
220  }
221  }
222 
223 
224  // d()/deta
225  case 1:
226  {
227  switch (i)
228  {
229  // constants
230  case 0:
231  return 0.;
232 
233  // linears
234  case 1:
235  return 0.;
236 
237  case 2:
238  return 1.;
239 
240  // quadratics
241  case 3:
242  return 0.;
243 
244  case 4:
245  return xi;
246 
247  case 5:
248  return 2.*eta;
249 
250  // cubics
251  case 6:
252  return 0.;
253 
254  case 7:
255  return xi*xi;
256 
257  case 8:
258  return 2.*xi*eta;
259 
260  case 9:
261  return 3.*eta*eta;
262 
263  // quartics
264  case 10:
265  return 0.;
266 
267  case 11:
268  return xi*xi*xi;
269 
270  case 12:
271  return 2.*xi*xi*eta;
272 
273  case 13:
274  return 3.*xi*eta*eta;
275 
276  case 14:
277  return 4.*eta*eta*eta;
278 
279  default:
280  unsigned int o = 0;
281  for (; i >= (o+1)*(o+2)/2; o++) { }
282  unsigned int ny = i - (o*(o+1)/2);
283  unsigned int nx = o - ny;
284  Real val = ny;
285  for (unsigned int index=0; index != nx; index++)
286  val *= xi;
287  for (unsigned int index=1; index < ny; index++)
288  val *= eta;
289  return val;
290  }
291  }
292 
293  default:
294  libmesh_error_msg("Invalid shape function derivative j = " << j);
295  }
296 
297  libmesh_error_msg("We'll never get here!");
298  return 0.;
299 
300 #endif
301 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, L2_LAGRANGE >::shape_deriv ( const ElemType  ,
const Order  order,
const unsigned int  i,
const unsigned int   libmesh_dbg_varj,
const Point p 
)

Definition at line 133 of file fe_l2_lagrange_shape_1D.C.

References libMesh::FIRST, libMesh::Real, libMesh::SECOND, and libMesh::THIRD.

138 {
139  // only d()/dxi in 1D!
140 
141  libmesh_assert_equal_to (j, 0);
142 
143  const Real xi = p(0);
144 
145 
146  switch (order)
147  {
148  // Lagrange linear shape function derivatives
149  case FIRST:
150  {
151  libmesh_assert_less (i, 2);
152 
153  switch (i)
154  {
155  case 0:
156  return -.5;
157 
158  case 1:
159  return .5;
160 
161  default:
162  libmesh_error_msg("Invalid shape function index i = " << i);
163  }
164  }
165 
166 
167  // Lagrange quadratic shape function derivatives
168  case SECOND:
169  {
170  libmesh_assert_less (i, 3);
171 
172  switch (i)
173  {
174  case 0:
175  return xi-.5;
176 
177  case 1:
178  return xi+.5;
179 
180  case 2:
181  return -2.*xi;
182 
183  default:
184  libmesh_error_msg("Invalid shape function index i = " << i);
185  }
186  }
187 
188 
189  // Lagrange cubic shape function derivatives
190  case THIRD:
191  {
192  libmesh_assert_less (i, 4);
193 
194  switch (i)
195  {
196  case 0:
197  return -9./16.*(3.*xi*xi-2.*xi-1./9.);
198 
199  case 1:
200  return -9./16.*(-3.*xi*xi-2.*xi+1./9.);
201 
202  case 2:
203  return 27./16.*(3.*xi*xi-2./3.*xi-1.);
204 
205  case 3:
206  return 27./16.*(-3.*xi*xi-2./3.*xi+1.);
207 
208  default:
209  libmesh_error_msg("Invalid shape function index i = " << i);
210  }
211  }
212 
213 
214  default:
215  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
216  }
217 
218  libmesh_error_msg("We'll never get here!");
219  return 0.;
220 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, LAGRANGE >::shape_deriv ( const ElemType  ,
const Order  order,
const unsigned int  i,
const unsigned int   libmesh_dbg_varj,
const Point p 
)

Definition at line 133 of file fe_lagrange_shape_1D.C.

References libMesh::FIRST, libMesh::Real, libMesh::SECOND, and libMesh::THIRD.

138 {
139  // only d()/dxi in 1D!
140 
141  libmesh_assert_equal_to (j, 0);
142 
143  const Real xi = p(0);
144 
145 
146  switch (order)
147  {
148  // Lagrange linear shape function derivatives
149  case FIRST:
150  {
151  libmesh_assert_less (i, 2);
152 
153  switch (i)
154  {
155  case 0:
156  return -.5;
157 
158  case 1:
159  return .5;
160 
161  default:
162  libmesh_error_msg("Invalid shape function index i = " << i);
163  }
164  }
165 
166 
167  // Lagrange quadratic shape function derivatives
168  case SECOND:
169  {
170  libmesh_assert_less (i, 3);
171 
172  switch (i)
173  {
174  case 0:
175  return xi-.5;
176 
177  case 1:
178  return xi+.5;
179 
180  case 2:
181  return -2.*xi;
182 
183  default:
184  libmesh_error_msg("Invalid shape function index i = " << i);
185  }
186  }
187 
188 
189  // Lagrange cubic shape function derivatives
190  case THIRD:
191  {
192  libmesh_assert_less (i, 4);
193 
194  switch (i)
195  {
196  case 0:
197  return -9./16.*(3.*xi*xi-2.*xi-1./9.);
198 
199  case 1:
200  return -9./16.*(-3.*xi*xi-2.*xi+1./9.);
201 
202  case 2:
203  return 27./16.*(3.*xi*xi-2./3.*xi-1.);
204 
205  case 3:
206  return 27./16.*(-3.*xi*xi-2./3.*xi+1.);
207 
208  default:
209  libmesh_error_msg("Invalid shape function index i = " << i);
210  }
211  }
212 
213 
214  default:
215  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
216  }
217 
218  libmesh_error_msg("We'll never get here!");
219  return 0.;
220 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<unsigned int Dim, FEFamily T>
static OutputShape libMesh::FE< Dim, T >::shape_deriv ( const ElemType  t,
const Order  o,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
static
Returns
the $ j^{th} $ derivative of the $ i^{th} $ shape function at point p. This method allows you to specify the dimension, element type, and order directly.

On a p-refined element, o should be the total order of the element.

Referenced by libMesh::FEMap::init_edge_shape_functions(), libMesh::FEMap::init_face_shape_functions(), libMesh::FEMap::init_reference_to_physical_map(), libMesh::FE< Dim, T >::init_shape_functions(), libMesh::FESubdivision::init_shape_functions(), libMesh::FE< Dim, T >::map_eta(), libMesh::FE< Dim, T >::map_xi(), libMesh::FE< Dim, T >::map_zeta(), and libMesh::FE< Dim, T >::shape_deriv().

template<>
Real libMesh::FE< 1, SZABAB >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 144 of file fe_szabab_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

149 {
150  libmesh_assert(elem);
151 
152  return FE<1,SZABAB>::shape_deriv(elem->type(),
153  static_cast<Order>(order + elem->p_level()), i, j, p);
154 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<unsigned int Dim, FEFamily T>
static OutputShape libMesh::FE< Dim, T >::shape_deriv ( const Elem elem,
const Order  o,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
static
Returns
the $ j^{th} $ derivative of the $ i^{th} $ shape function. You must specify element type, and order directly.

On a p-refined element, o should be the base order of the element.

template<>
Real libMesh::FE< 2, XYZ >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 153 of file fe_xyz_shape_2D.C.

158 {
159  libmesh_error_msg("XYZ polynomials require the element \nbecause the centroid is needed.");
160  return 0.;
161 }
template<>
RealGradient libMesh::FE< 2, NEDELEC_ONE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 166 of file fe_nedelec_one_shape_2D.C.

171 {
172  libmesh_error_msg("Nedelec elements require the element type \nbecause edge orientation is needed.");
173  return RealGradient();
174 }
RealVectorValue RealGradient
template<>
Real libMesh::FE< 2, XYZ >::shape_deriv ( const Elem elem,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point point_in 
)

Definition at line 166 of file fe_xyz_shape_2D.C.

References std::abs(), libMesh::Elem::centroid(), libMesh::libmesh_assert(), std::max(), libMesh::Elem::n_nodes(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::Real, and libMesh::x.

171 {
172 #if LIBMESH_DIM > 1
173 
174 
175  libmesh_assert_less (j, 2);
176  libmesh_assert(elem);
177 
178  Point centroid = elem->centroid();
179  Point max_distance = Point(0.,0.,0.);
180  for (unsigned int p = 0; p < elem->n_nodes(); p++)
181  for (unsigned int d = 0; d < 2; d++)
182  {
183  const Real distance = std::abs(centroid(d) - elem->point(p)(d));
184  max_distance(d) = std::max(distance, max_distance(d));
185  }
186 
187  const Real x = point_in(0);
188  const Real y = point_in(1);
189  const Real xc = centroid(0);
190  const Real yc = centroid(1);
191  const Real distx = max_distance(0);
192  const Real disty = max_distance(1);
193  const Real dx = (x - xc)/distx;
194  const Real dy = (y - yc)/disty;
195 
196 #ifndef NDEBUG
197  // totalorder is only used in the assertion below, so
198  // we avoid declaring it when asserts are not active.
199  const unsigned int totalorder = order + elem->p_level();
200 #endif
201  libmesh_assert_less (i, (totalorder+1)*(totalorder+2)/2);
202 
203  // monomials. since they are hierarchic we only need one case block.
204 
205  switch (j)
206  {
207  // d()/dx
208  case 0:
209  {
210  switch (i)
211  {
212  // constants
213  case 0:
214  return 0.;
215 
216  // linears
217  case 1:
218  return 1./distx;
219 
220  case 2:
221  return 0.;
222 
223  // quadratics
224  case 3:
225  return 2.*dx/distx;
226 
227  case 4:
228  return dy/distx;
229 
230  case 5:
231  return 0.;
232 
233  // cubics
234  case 6:
235  return 3.*dx*dx/distx;
236 
237  case 7:
238  return 2.*dx*dy/distx;
239 
240  case 8:
241  return dy*dy/distx;
242 
243  case 9:
244  return 0.;
245 
246  // quartics
247  case 10:
248  return 4.*dx*dx*dx/distx;
249 
250  case 11:
251  return 3.*dx*dx*dy/distx;
252 
253  case 12:
254  return 2.*dx*dy*dy/distx;
255 
256  case 13:
257  return dy*dy*dy/distx;
258 
259  case 14:
260  return 0.;
261 
262  default:
263  unsigned int o = 0;
264  for (; i >= (o+1)*(o+2)/2; o++) { }
265  unsigned int i2 = i - (o*(o+1)/2);
266  Real val = o - i2;
267  for (unsigned int index=i2+1; index < o; index++)
268  val *= dx;
269  for (unsigned int index=0; index != i2; index++)
270  val *= dy;
271  return val/distx;
272  }
273  }
274 
275 
276  // d()/dy
277  case 1:
278  {
279  switch (i)
280  {
281  // constants
282  case 0:
283  return 0.;
284 
285  // linears
286  case 1:
287  return 0.;
288 
289  case 2:
290  return 1./disty;
291 
292  // quadratics
293  case 3:
294  return 0.;
295 
296  case 4:
297  return dx/disty;
298 
299  case 5:
300  return 2.*dy/disty;
301 
302  // cubics
303  case 6:
304  return 0.;
305 
306  case 7:
307  return dx*dx/disty;
308 
309  case 8:
310  return 2.*dx*dy/disty;
311 
312  case 9:
313  return 3.*dy*dy/disty;
314 
315  // quartics
316  case 10:
317  return 0.;
318 
319  case 11:
320  return dx*dx*dx/disty;
321 
322  case 12:
323  return 2.*dx*dx*dy/disty;
324 
325  case 13:
326  return 3.*dx*dy*dy/disty;
327 
328  case 14:
329  return 4.*dy*dy*dy/disty;
330 
331  default:
332  unsigned int o = 0;
333  for (; i >= (o+1)*(o+2)/2; o++) { }
334  unsigned int i2 = i - (o*(o+1)/2);
335  Real val = i2;
336  for (unsigned int index=i2; index != o; index++)
337  val *= dx;
338  for (unsigned int index=1; index <= i2; index++)
339  val *= dy;
340  return val/disty;
341  }
342  }
343 
344 
345  default:
346  libmesh_error_msg("Invalid j = " << j);
347  }
348 
349  libmesh_error_msg("We'll never get here!");
350  return 0.;
351 
352 #endif
353 }
double abs(double a)
libmesh_assert(remote_elem)
long double max(long double a, double b)
PetscErrorCode Vec x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
RealGradient libMesh::FE< 2, NEDELEC_ONE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point  
)

Definition at line 179 of file fe_nedelec_one_shape_2D.C.

References libMesh::FIRST, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::QUAD8, libMesh::QUAD9, libMesh::Real, libMesh::TRI6, and libMesh::Elem::type().

184 {
185 #if LIBMESH_DIM > 1
186  libmesh_assert(elem);
187  libmesh_assert_less (j, 2);
188 
189  const Order total_order = static_cast<Order>(order + elem->p_level());
190 
191  switch (total_order)
192  {
193  // linear Lagrange shape functions
194  case FIRST:
195  {
196  switch (elem->type())
197  {
198  case QUAD8:
199  case QUAD9:
200  {
201  libmesh_assert_less (i, 4);
202 
203  switch (j)
204  {
205  // d()/dxi
206  case 0:
207  {
208  switch(i)
209  {
210  case 0:
211  case 2:
212  return RealGradient();
213  case 1:
214  {
215  if( elem->point(1) > elem->point(2) )
216  return RealGradient( 0.0, -0.25 );
217  else
218  return RealGradient( 0.0, 0.25 );
219  }
220  case 3:
221  {
222  if( elem->point(3) > elem->point(0) )
223  return RealGradient( 0.0, -0.25 );
224  else
225  return RealGradient( 0.0, 0.25 );
226  }
227  default:
228  libmesh_error_msg("Invalid i = " << i);
229  }
230  } // j=0
231 
232  // d()/deta
233  case 1:
234  {
235  switch(i)
236  {
237  case 1:
238  case 3:
239  return RealGradient();
240  case 0:
241  {
242  if( elem->point(0) > elem->point(1) )
243  return RealGradient( 0.25 );
244  else
245  return RealGradient( -0.25 );
246  }
247  case 2:
248  {
249  if( elem->point(2) > elem->point(3) )
250  return RealGradient( 0.25 );
251  else
252  return RealGradient( -0.25 );
253  }
254  default:
255  libmesh_error_msg("Invalid i = " << i);
256  }
257  } // j=1
258 
259  default:
260  libmesh_error_msg("Invalid j = " << j);
261  }
262 
263  return RealGradient();
264  }
265 
266  case TRI6:
267  {
268  libmesh_assert_less (i, 3);
269 
270  // Account for edge flipping
271  Real f = 1.0;
272 
273  switch(i)
274  {
275  case 0:
276  {
277  if( elem->point(0) > elem->point(1) )
278  f = -1.0;
279  break;
280  }
281  case 1:
282  {
283  if( elem->point(1) > elem->point(2) )
284  f = -1.0;
285  break;
286  }
287  case 2:
288  {
289  if( elem->point(2) > elem->point(0) )
290  f = -1.0;
291  break;
292  }
293  default:
294  libmesh_error_msg("Invalid i = " << i);
295  }
296 
297  switch (j)
298  {
299  // d()/dxi
300  case 0:
301  {
302  return RealGradient( 0.0, f*1.0);
303  }
304  // d()/deta
305  case 1:
306  {
307  return RealGradient( f*(-1.0) );
308  }
309  default:
310  libmesh_error_msg("Invalid j = " << j);
311  }
312  }
313 
314  default:
315  libmesh_error_msg("ERROR: Unsupported 2D element type!: " << elem->type());
316  }
317  }
318  // unsupported order
319  default:
320  libmesh_error_msg("ERROR: Unsupported 2D FE order!: " << total_order);
321  }
322 #endif // LIBMESH_DIM > 1
323 
324  libmesh_error_msg("We'll never get here!");
325  return RealGradient();
326 }
RealVectorValue RealGradient
libmesh_assert(remote_elem)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, HIERARCHIC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 185 of file fe_hierarchic_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

190 {
191  libmesh_assert(elem);
192 
193  return FE<1,HIERARCHIC>::shape_deriv(elem->type(),
194  static_cast<Order>(order + elem->p_level()), i, j, p);
195 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 1, L2_HIERARCHIC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 185 of file fe_l2_hierarchic_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

190 {
191  libmesh_assert(elem);
192 
193  return FE<1,L2_HIERARCHIC>::shape_deriv(elem->type(),
194  static_cast<Order>(order + elem->p_level()), i, j, p);
195 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
RealGradient libMesh::FE< 3, NEDELEC_ONE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 195 of file fe_nedelec_one_shape_3D.C.

200 {
201  libmesh_error_msg("Nedelec elements require the element type \nbecause edge orientation is needed.");
202  return RealGradient();
203 }
RealVectorValue RealGradient
template<>
Real libMesh::FE< 3, MONOMIAL >::shape_deriv ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 201 of file fe_monomial_shape_3D.C.

References libMesh::Real.

206 {
207 #if LIBMESH_DIM == 3
208 
209  libmesh_assert_less (j, 3);
210 
211  libmesh_assert_less (i, (static_cast<unsigned int>(order)+1)*
212  (static_cast<unsigned int>(order)+2)*
213  (static_cast<unsigned int>(order)+3)/6);
214 
215 
216  const Real xi = p(0);
217  const Real eta = p(1);
218  const Real zeta = p(2);
219 
220  // monomials. since they are hierarchic we only need one case block.
221  switch (j)
222  {
223  // d()/dxi
224  case 0:
225  {
226  switch (i)
227  {
228  // constant
229  case 0:
230  return 0.;
231 
232  // linear
233  case 1:
234  return 1.;
235 
236  case 2:
237  return 0.;
238 
239  case 3:
240  return 0.;
241 
242  // quadratic
243  case 4:
244  return 2.*xi;
245 
246  case 5:
247  return eta;
248 
249  case 6:
250  return 0.;
251 
252  case 7:
253  return zeta;
254 
255  case 8:
256  return 0.;
257 
258  case 9:
259  return 0.;
260 
261  // cubic
262  case 10:
263  return 3.*xi*xi;
264 
265  case 11:
266  return 2.*xi*eta;
267 
268  case 12:
269  return eta*eta;
270 
271  case 13:
272  return 0.;
273 
274  case 14:
275  return 2.*xi*zeta;
276 
277  case 15:
278  return eta*zeta;
279 
280  case 16:
281  return 0.;
282 
283  case 17:
284  return zeta*zeta;
285 
286  case 18:
287  return 0.;
288 
289  case 19:
290  return 0.;
291 
292  // quartics
293  case 20:
294  return 4.*xi*xi*xi;
295 
296  case 21:
297  return 3.*xi*xi*eta;
298 
299  case 22:
300  return 2.*xi*eta*eta;
301 
302  case 23:
303  return eta*eta*eta;
304 
305  case 24:
306  return 0.;
307 
308  case 25:
309  return 3.*xi*xi*zeta;
310 
311  case 26:
312  return 2.*xi*eta*zeta;
313 
314  case 27:
315  return eta*eta*zeta;
316 
317  case 28:
318  return 0.;
319 
320  case 29:
321  return 2.*xi*zeta*zeta;
322 
323  case 30:
324  return eta*zeta*zeta;
325 
326  case 31:
327  return 0.;
328 
329  case 32:
330  return zeta*zeta*zeta;
331 
332  case 33:
333  return 0.;
334 
335  case 34:
336  return 0.;
337 
338  default:
339  unsigned int o = 0;
340  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
341  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
342  unsigned int block=o, nz = 0;
343  for (; block < i2; block += (o-nz+1)) { nz++; }
344  const unsigned int nx = block - i2;
345  const unsigned int ny = o - nx - nz;
346  Real val = nx;
347  for (unsigned int index=1; index < nx; index++)
348  val *= xi;
349  for (unsigned int index=0; index != ny; index++)
350  val *= eta;
351  for (unsigned int index=0; index != nz; index++)
352  val *= zeta;
353  return val;
354  }
355  }
356 
357 
358  // d()/deta
359  case 1:
360  {
361  switch (i)
362  {
363  // constant
364  case 0:
365  return 0.;
366 
367  // linear
368  case 1:
369  return 0.;
370 
371  case 2:
372  return 1.;
373 
374  case 3:
375  return 0.;
376 
377  // quadratic
378  case 4:
379  return 0.;
380 
381  case 5:
382  return xi;
383 
384  case 6:
385  return 2.*eta;
386 
387  case 7:
388  return 0.;
389 
390  case 8:
391  return zeta;
392 
393  case 9:
394  return 0.;
395 
396  // cubic
397  case 10:
398  return 0.;
399 
400  case 11:
401  return xi*xi;
402 
403  case 12:
404  return 2.*xi*eta;
405 
406  case 13:
407  return 3.*eta*eta;
408 
409  case 14:
410  return 0.;
411 
412  case 15:
413  return xi*zeta;
414 
415  case 16:
416  return 2.*eta*zeta;
417 
418  case 17:
419  return 0.;
420 
421  case 18:
422  return zeta*zeta;
423 
424  case 19:
425  return 0.;
426 
427  // quartics
428  case 20:
429  return 0.;
430 
431  case 21:
432  return xi*xi*xi;
433 
434  case 22:
435  return 2.*xi*xi*eta;
436 
437  case 23:
438  return 3.*xi*eta*eta;
439 
440  case 24:
441  return 4.*eta*eta*eta;
442 
443  case 25:
444  return 0.;
445 
446  case 26:
447  return xi*xi*zeta;
448 
449  case 27:
450  return 2.*xi*eta*zeta;
451 
452  case 28:
453  return 3.*eta*eta*zeta;
454 
455  case 29:
456  return 0.;
457 
458  case 30:
459  return xi*zeta*zeta;
460 
461  case 31:
462  return 2.*eta*zeta*zeta;
463 
464  case 32:
465  return 0.;
466 
467  case 33:
468  return zeta*zeta*zeta;
469 
470  case 34:
471  return 0.;
472 
473  default:
474  unsigned int o = 0;
475  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
476  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
477  unsigned int block=o, nz = 0;
478  for (; block < i2; block += (o-nz+1)) { nz++; }
479  const unsigned int nx = block - i2;
480  const unsigned int ny = o - nx - nz;
481  Real val = ny;
482  for (unsigned int index=0; index != nx; index++)
483  val *= xi;
484  for (unsigned int index=1; index < ny; index++)
485  val *= eta;
486  for (unsigned int index=0; index != nz; index++)
487  val *= zeta;
488  return val;
489  }
490  }
491 
492 
493  // d()/dzeta
494  case 2:
495  {
496  switch (i)
497  {
498  // constant
499  case 0:
500  return 0.;
501 
502  // linear
503  case 1:
504  return 0.;
505 
506  case 2:
507  return 0.;
508 
509  case 3:
510  return 1.;
511 
512  // quadratic
513  case 4:
514  return 0.;
515 
516  case 5:
517  return 0.;
518 
519  case 6:
520  return 0.;
521 
522  case 7:
523  return xi;
524 
525  case 8:
526  return eta;
527 
528  case 9:
529  return 2.*zeta;
530 
531  // cubic
532  case 10:
533  return 0.;
534 
535  case 11:
536  return 0.;
537 
538  case 12:
539  return 0.;
540 
541  case 13:
542  return 0.;
543 
544  case 14:
545  return xi*xi;
546 
547  case 15:
548  return xi*eta;
549 
550  case 16:
551  return eta*eta;
552 
553  case 17:
554  return 2.*xi*zeta;
555 
556  case 18:
557  return 2.*eta*zeta;
558 
559  case 19:
560  return 3.*zeta*zeta;
561 
562  // quartics
563  case 20:
564  return 0.;
565 
566  case 21:
567  return 0.;
568 
569  case 22:
570  return 0.;
571 
572  case 23:
573  return 0.;
574 
575  case 24:
576  return 0.;
577 
578  case 25:
579  return xi*xi*xi;
580 
581  case 26:
582  return xi*xi*eta;
583 
584  case 27:
585  return xi*eta*eta;
586 
587  case 28:
588  return eta*eta*eta;
589 
590  case 29:
591  return 2.*xi*xi*zeta;
592 
593  case 30:
594  return 2.*xi*eta*zeta;
595 
596  case 31:
597  return 2.*eta*eta*zeta;
598 
599  case 32:
600  return 3.*xi*zeta*zeta;
601 
602  case 33:
603  return 3.*eta*zeta*zeta;
604 
605  case 34:
606  return 4.*zeta*zeta*zeta;
607 
608  default:
609  unsigned int o = 0;
610  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
611  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
612  unsigned int block=o, nz = 0;
613  for (; block < i2; block += (o-nz+1)) { nz++; }
614  const unsigned int nx = block - i2;
615  const unsigned int ny = o - nx - nz;
616  Real val = nz;
617  for (unsigned int index=0; index != nx; index++)
618  val *= xi;
619  for (unsigned int index=0; index != ny; index++)
620  val *= eta;
621  for (unsigned int index=1; index < nz; index++)
622  val *= zeta;
623  return val;
624  }
625  }
626 
627  default:
628  libmesh_error_msg("Invalid shape function derivative j = " << j);
629  }
630 
631 #endif
632 
633  libmesh_error_msg("We'll never get here!");
634  return 0.;
635 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, BERNSTEIN >::shape_deriv ( const ElemType  ,
const Order  order,
const unsigned int  i,
const unsigned int   libmesh_dbg_varj,
const Point p 
)

Definition at line 205 of file fe_bernstein_shape_1D.C.

References libMesh::Utility::binomial(), libMesh::FIFTH, libMesh::FIRST, libMesh::FOURTH, libMesh::libmesh_assert(), std::pow(), libMesh::Utility::pow(), libMesh::Real, libMesh::SECOND, libMesh::SIXTH, and libMesh::THIRD.

210 {
211  // only d()/dxi in 1D!
212 
213  libmesh_assert_equal_to (j, 0);
214 
215  const Real xi = p(0);
216 
217  using Utility::pow;
218 
219  switch (order)
220  {
221  case FIRST:
222 
223  switch(i)
224  {
225  case 0:
226  return -.5;
227  case 1:
228  return .5;
229  default:
230  libmesh_error_msg("Invalid shape function index i = " << i);
231  }
232 
233  case SECOND:
234 
235  switch(i)
236  {
237  case 0:
238  return (xi-1.)*.5;
239  case 1:
240  return (xi+1.)*.5;
241  case 2:
242  return -xi;
243  default:
244  libmesh_error_msg("Invalid shape function index i = " << i);
245  }
246 
247  case THIRD:
248 
249  switch(i)
250  {
251  case 0:
252  return -0.375*pow<2>(1.-xi);
253  case 1:
254  return 0.375*pow<2>(1.+xi);
255  case 2:
256  return -0.375 -.75*xi +1.125*pow<2>(xi);
257  case 3:
258  return 0.375 -.75*xi -1.125*pow<2>(xi);
259  default:
260  libmesh_error_msg("Invalid shape function index i = " << i);
261  }
262 
263  case FOURTH:
264 
265  switch(i)
266  {
267  case 0:
268  return -0.25*pow<3>(1.-xi);
269  case 1:
270  return 0.25*pow<3>(1.+xi);
271  case 2:
272  return -0.5 +1.5*pow<2>(xi)-pow<3>(xi);
273  case 3:
274  return 1.5*(pow<3>(xi)-xi);
275  case 4:
276  return 0.5 -1.5*pow<2>(xi)-pow<3>(xi);
277  default:
278  libmesh_error_msg("Invalid shape function index i = " << i);
279  }
280 
281  case FIFTH:
282 
283  switch(i)
284  {
285  case 0:
286  return -(5./32.)*pow<4>(xi-1.);
287  case 1:
288  return (5./32.)*pow<4>(xi+1.);
289  case 2:
290  return (5./32.)*pow<4>(1.-xi) -(5./8.)*(1.+xi)*pow<3>(1.-xi);
291  case 3:
292  return (5./ 8.)*(1.+xi)*pow<3>(1.-xi) -(15./16.)*pow<2>(1.+xi)*pow<2>(1.-xi);
293  case 4:
294  return -(5./ 8.)*pow<3>(1.+xi)*(1.-xi) +(15./16.)*pow<2>(1.+xi)*pow<2>(1.-xi);
295  case 5:
296  return (5./ 8.)*pow<3>(1.+xi)*(1.-xi) -(5./32.)*pow<4>(1.+xi);
297  default:
298  libmesh_error_msg("Invalid shape function index i = " << i);
299  }
300 
301  case SIXTH:
302 
303  switch(i)
304  {
305  case 0:
306  return -( 3./32.)*pow<5>(1.-xi);
307  case 1:
308  return ( 3./32.)*pow<5>(1.+xi);
309  case 2:
310  return ( 3./32.)*pow<5>(1.-xi)-(15./32.)*(1.+xi)*pow<4>(1.-xi);
311  case 3:
312  return (15./32.)*(1.+xi)*pow<4>(1.-xi)-(15./16.)*pow<2>(1.+xi)*pow<3>(1.-xi);
313  case 4:
314  return -(15./ 8.)*xi +(15./4.)*pow<3>(xi)-(15./8.)*pow<5>(xi);
315  case 5:
316  return -(15./32.)*(1.-xi)*pow<4>(1.+xi)+(15./16.)*pow<2>(1.-xi)*pow<3>(1.+xi);
317  case 6:
318  return (15./32.)*pow<4>(1.+xi)*(1.-xi)-(3./32.)*pow<5>(1.+xi);
319  default:
320  libmesh_error_msg("Invalid shape function index i = " << i);
321  }
322 
323 
324  default:
325  {
326  libmesh_assert (order>6);
327 
328  // Use this for arbitrary orders
329  const int p_order = static_cast<int>(order);
330  const int m = p_order-(i-1);
331  const int n = (i-1);
332 
333  // Using an unsigned long here will work for any of the orders we support.
334  unsigned long binomial_p_i = 1;
335 
336  // the binomial coefficient (p choose n)
337  if (i>1)
338  binomial_p_i = Utility::binomial(static_cast<unsigned long>(p_order),
339  static_cast<unsigned long>(n));
340 
341  switch(i)
342  {
343  case 0:
344  return binomial_p_i * (-1./2.) * p_order * std::pow((1-xi)/2, p_order-1);
345  case 1:
346  return binomial_p_i * ( 1./2.) * p_order * std::pow((1+xi)/2, p_order-1);
347 
348  default:
349  {
350  return binomial_p_i * (1./2. * n * std::pow((1+xi)/2,n-1) * std::pow((1-xi)/2,m)
351  - 1./2. * m * std::pow((1+xi)/2,n) * std::pow((1-xi)/2,m-1));
352  }
353  }
354  }
355 
356  }
357 
358  libmesh_error_msg("We'll never get here!");
359  return 0.;
360 }
libmesh_assert(remote_elem)
T pow(const T &x)
Definition: utility.h:194
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
T binomial(T n, T k)
Definition: utility.h:221
template<>
RealGradient libMesh::FE< 3, NEDELEC_ONE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 206 of file fe_nedelec_one_shape_3D.C.

References libMesh::FIRST, libMesh::HEX20, libMesh::HEX27, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::Real, libMesh::TET10, libMesh::TOLERANCE, and libMesh::Elem::type().

211 {
212 #if LIBMESH_DIM == 3
213  libmesh_assert(elem);
214  libmesh_assert_less (j, 3);
215 
216  const Order totalorder = static_cast<Order>(order + elem->p_level());
217 
218  switch (totalorder)
219  {
220  case FIRST:
221  {
222  switch (elem->type())
223  {
224  case HEX20:
225  case HEX27:
226  {
227  libmesh_assert_less (i, 12);
228 
229  const Real xi = p(0);
230  const Real eta = p(1);
231  const Real zeta = p(2);
232 
233  // Even with a loose inverse_map tolerance we ought to
234  // be nearly on the element interior in master
235  // coordinates
236  libmesh_assert_less_equal ( std::fabs(xi), 1.0+TOLERANCE );
237  libmesh_assert_less_equal ( std::fabs(eta), 1.0+TOLERANCE );
238  libmesh_assert_less_equal ( std::fabs(zeta), 1.0+TOLERANCE );
239 
240  switch (j)
241  {
242  // d()/dxi
243  case 0:
244  {
245  switch(i)
246  {
247  case 0:
248  case 2:
249  case 8:
250  case 10:
251  return RealGradient();
252  case 1:
253  {
254  if( elem->point(1) > elem->point(2) )
255  return RealGradient( 0.0, -0.125*(1.0-zeta) );
256  else
257  return RealGradient( 0.0, 0.125*(1.0-zeta) );
258  }
259  case 3:
260  {
261  if( elem->point(3) > elem->point(0) )
262  return RealGradient( 0.0, 0.125*(-1.0+zeta) );
263  else
264  return RealGradient( 0.0, -0.125*(-1.0+zeta) );
265  }
266  case 4:
267  {
268  if( elem->point(0) > elem->point(4) )
269  return RealGradient( 0.0, 0.0, -0.125*(-1.0+eta) );
270  else
271  return RealGradient( 0.0, 0.0, 0.125*(-1.0+eta) );
272  }
273  case 5:
274  {
275  if( elem->point(1) > elem->point(5) )
276  return RealGradient( 0.0, 0.0, -0.125*(1.0-eta) );
277  else
278  return RealGradient( 0.0, 0.0, 0.125*(1.0-eta) );
279  }
280  case 6:
281  {
282  if( elem->point(2) > elem->point(6) )
283  return RealGradient( 0.0, 0.0, -0.125*(1.0+eta) );
284  else
285  return RealGradient( 0.0, 0.0, 0.125*(1.0+eta) );
286  }
287  case 7:
288  {
289  if( elem->point(3) > elem->point(7) )
290  return RealGradient( 0.0, 0.0, -0.125*(-1.0-eta) );
291  else
292  return RealGradient( 0.0, 0.0, 0.125*(-1.0-eta) );
293  }
294  case 9:
295  {
296  if( elem->point(5) > elem->point(6) )
297  return RealGradient( 0.0, -0.125*(1.0+zeta), 0.0 );
298  else
299  return RealGradient( 0.0, 0.125*(1.0+zeta), 0.0 );
300  }
301  case 11:
302  {
303  if( elem->point(4) > elem->point(7) )
304  return RealGradient( 0.0, -0.125*(-1.0-zeta), 0.0 );
305  else
306  return RealGradient( 0.0, 0.125*(-1.0-zeta), 0.0 );
307  }
308  default:
309  libmesh_error_msg("Invalid i = " << i);
310  } // switch(i)
311 
312  } // j=0
313 
314  // d()/deta
315  case 1:
316  {
317  switch(i)
318  {
319  case 1:
320  case 3:
321  case 9:
322  case 11:
323  return RealGradient();
324  case 0:
325  {
326  if( elem->point(0) > elem->point(1) )
327  return RealGradient( -0.125*(-1.0+zeta), 0.0, 0.0 );
328  else
329  return RealGradient( 0.125*(-1.0+zeta), 0.0, 0.0 );
330  }
331  case 2:
332  {
333  if( elem->point(2) > elem->point(3) )
334  return RealGradient( 0.125*(1.0-zeta), 0.0, 0.0 );
335  else
336  return RealGradient( -0.125*(1.0-zeta), 0.0, 0.0 );
337  }
338  case 4:
339  {
340  if( elem->point(0) > elem->point(4) )
341  return RealGradient( 0.0, 0.0, -0.125*(-1.0+xi) );
342  else
343  return RealGradient( 0.0, 0.0, 0.125*(-1.0+xi) );
344  }
345  case 5:
346  {
347  if( elem->point(1) > elem->point(5) )
348  return RealGradient( 0.0, 0.0, -0.125*(-1.0-xi) );
349  else
350  return RealGradient( 0.0, 0.0, 0.125*(-1.0-xi) );
351  }
352  case 6:
353  {
354  if( elem->point(2) > elem->point(6) )
355  return RealGradient( 0.0, 0.0, -0.125*(1.0+xi) );
356  else
357  return RealGradient( 0.0, 0.0, 0.125*(1.0+xi) );
358  }
359  case 7:
360  {
361  if( elem->point(3) > elem->point(7) )
362  return RealGradient( 0.0, 0.0, -0.125*(1.0-xi) );
363  else
364  return RealGradient( 0.0, 0.0, 0.125*(1.0-xi) );
365  }
366  case 8:
367  {
368  if( elem->point(4) > elem->point(5) )
369  return RealGradient( -0.125*(-1.0-zeta), 0.0, 0.0 );
370  else
371  return RealGradient( 0.125*(-1.0-zeta), 0.0, 0.0 );
372  }
373  case 10:
374  {
375  if( elem->point(7) > elem->point(6) )
376  return RealGradient( -0.125*(1.0+zeta), 0.0, 0.0 );
377  else
378  return RealGradient( 0.125*(1.0+zeta), 0.0, 0.0 );
379  }
380  default:
381  libmesh_error_msg("Invalid i = " << i);
382  } // switch(i)
383 
384  } // j=1
385 
386  // d()/dzeta
387  case 2:
388  {
389  switch(i)
390  {
391  case 4:
392  case 5:
393  case 6:
394  case 7:
395  return RealGradient();
396 
397  case 0:
398  {
399  if( elem->point(0) > elem->point(1) )
400  return RealGradient( -0.125*(-1.0+eta), 0.0, 0.0 );
401  else
402  return RealGradient( 0.125*(-1.0+eta), 0.0, 0.0 );
403  }
404  case 1:
405  {
406  if( elem->point(1) > elem->point(2) )
407  return RealGradient( 0.0, -0.125*(-1.0-xi), 0.0 );
408  else
409  return RealGradient( 0.0, 0.125*(-1.0-xi), 0.0 );
410  }
411  case 2:
412  {
413  if( elem->point(2) > elem->point(3) )
414  return RealGradient( 0.125*(-1.0-eta), 0.0, 0.0 );
415  else
416  return RealGradient( -0.125*(-1.0-eta), 0.0, 0.0 );
417  }
418  case 3:
419  {
420  if( elem->point(3) > elem->point(0) )
421  return RealGradient( 0.0, 0.125*(-1.0+xi), 0.0 );
422  else
423  return RealGradient( 0.0, -0.125*(-1.0+xi), 0.0 );
424  }
425  case 8:
426  {
427  if( elem->point(4) > elem->point(5) )
428  return RealGradient( -0.125*(1.0-eta), 0.0, 0.0 );
429  else
430  return RealGradient( 0.125*(1.0-eta), 0.0, 0.0 );
431  }
432  case 9:
433  {
434  if( elem->point(5) > elem->point(6) )
435  return RealGradient( 0.0, -0.125*(1.0+xi), 0.0 );
436  else
437  return RealGradient( 0.0, 0.125*(1.0+xi), 0.0 );
438  }
439  case 10:
440  {
441  if( elem->point(7) > elem->point(6) )
442  return RealGradient( -0.125*(1.0+eta), 0.0, 0.0 );
443  else
444  return RealGradient( 0.125*(1.0+eta), 0.0, 0.0 );
445  }
446  case 11:
447  {
448  if( elem->point(4) > elem->point(7) )
449  return RealGradient( 0.0, -0.125*(1.0-xi), 0.0 );
450  else
451  return RealGradient( 0.0, 0.125*(1.0-xi), 0.0 );
452  }
453  default:
454  libmesh_error_msg("Invalid i = " << i);
455  } // switch(i)
456 
457  } // j = 2
458 
459  default:
460  libmesh_error_msg("Invalid j = " << j);
461  }
462 
463  return RealGradient();
464  }
465 
466  case TET10:
467  {
468  libmesh_assert_less (i, 6);
469 
470  libmesh_not_implemented();
471  return RealGradient();
472  }
473 
474  default:
475  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << elem->type());
476  }
477  }
478 
479  // unsupported order
480  default:
481  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << totalorder);
482  }
483 
484 #endif
485 
486  libmesh_error_msg("We'll never get here!");
487  return RealGradient();
488 }
RealVectorValue RealGradient
libmesh_assert(remote_elem)
static const Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, XYZ >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 223 of file fe_xyz_shape_3D.C.

228 {
229  libmesh_error_msg("XYZ polynomials require the element \nbecause the centroid is needed.");
230  return 0.;
231 }
template<>
Real libMesh::FE< 2, LAGRANGE >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 223 of file fe_lagrange_shape_2D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::FIRST, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::Real, libMesh::SECOND, libMesh::TRI3, libMesh::TRI6, and libMesh::TRISHELL3.

228 {
229 #if LIBMESH_DIM > 1
230 
231 
232  libmesh_assert_less (j, 2);
233 
234  switch (order)
235  {
236  // linear Lagrange shape functions
237  case FIRST:
238  {
239  switch (type)
240  {
241  case QUAD4:
242  case QUADSHELL4:
243  case QUAD8:
244  case QUAD9:
245  {
246  // Compute quad shape functions as a tensor-product
247  const Real xi = p(0);
248  const Real eta = p(1);
249 
250  libmesh_assert_less (i, 4);
251 
252  // 0 1 2 3
253  static const unsigned int i0[] = {0, 1, 1, 0};
254  static const unsigned int i1[] = {0, 0, 1, 1};
255 
256  switch (j)
257  {
258  // d()/dxi
259  case 0:
260  return (FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
261  FE<1,LAGRANGE>::shape (EDGE2, FIRST, i1[i], eta));
262 
263  // d()/deta
264  case 1:
265  return (FE<1,LAGRANGE>::shape (EDGE2, FIRST, i0[i], xi)*
266  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta));
267 
268  default:
269  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
270  }
271  }
272 
273  case TRI3:
274  case TRISHELL3:
275  case TRI6:
276  {
277  libmesh_assert_less (i, 3);
278 
279  const Real dzeta0dxi = -1.;
280  const Real dzeta1dxi = 1.;
281  const Real dzeta2dxi = 0.;
282 
283  const Real dzeta0deta = -1.;
284  const Real dzeta1deta = 0.;
285  const Real dzeta2deta = 1.;
286 
287  switch (j)
288  {
289  // d()/dxi
290  case 0:
291  {
292  switch(i)
293  {
294  case 0:
295  return dzeta0dxi;
296 
297  case 1:
298  return dzeta1dxi;
299 
300  case 2:
301  return dzeta2dxi;
302 
303  default:
304  libmesh_error_msg("Invalid shape function index i = " << i);
305  }
306  }
307  // d()/deta
308  case 1:
309  {
310  switch(i)
311  {
312  case 0:
313  return dzeta0deta;
314 
315  case 1:
316  return dzeta1deta;
317 
318  case 2:
319  return dzeta2deta;
320 
321  default:
322  libmesh_error_msg("Invalid shape function index i = " << i);
323  }
324  }
325  default:
326  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
327  }
328  }
329 
330  default:
331  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
332  }
333  }
334 
335 
336  // quadratic Lagrange shape functions
337  case SECOND:
338  {
339  switch (type)
340  {
341  case QUAD8:
342  {
343  const Real xi = p(0);
344  const Real eta = p(1);
345 
346  libmesh_assert_less (i, 8);
347 
348  switch (j)
349  {
350  // d/dxi
351  case 0:
352  switch (i)
353  {
354  case 0:
355  return .25*(1. - eta)*((1. - xi)*(-1.) +
356  (-1.)*(-1. - xi - eta));
357 
358  case 1:
359  return .25*(1. - eta)*((1. + xi)*(1.) +
360  (1.)*(-1. + xi - eta));
361 
362  case 2:
363  return .25*(1. + eta)*((1. + xi)*(1.) +
364  (1.)*(-1. + xi + eta));
365 
366  case 3:
367  return .25*(1. + eta)*((1. - xi)*(-1.) +
368  (-1.)*(-1. - xi + eta));
369 
370  case 4:
371  return .5*(-2.*xi)*(1. - eta);
372 
373  case 5:
374  return .5*(1.)*(1. - eta*eta);
375 
376  case 6:
377  return .5*(-2.*xi)*(1. + eta);
378 
379  case 7:
380  return .5*(-1.)*(1. - eta*eta);
381 
382  default:
383  libmesh_error_msg("Invalid shape function index i = " << i);
384  }
385 
386  // d/deta
387  case 1:
388  switch (i)
389  {
390  case 0:
391  return .25*(1. - xi)*((1. - eta)*(-1.) +
392  (-1.)*(-1. - xi - eta));
393 
394  case 1:
395  return .25*(1. + xi)*((1. - eta)*(-1.) +
396  (-1.)*(-1. + xi - eta));
397 
398  case 2:
399  return .25*(1. + xi)*((1. + eta)*(1.) +
400  (1.)*(-1. + xi + eta));
401 
402  case 3:
403  return .25*(1. - xi)*((1. + eta)*(1.) +
404  (1.)*(-1. - xi + eta));
405 
406  case 4:
407  return .5*(1. - xi*xi)*(-1.);
408 
409  case 5:
410  return .5*(1. + xi)*(-2.*eta);
411 
412  case 6:
413  return .5*(1. - xi*xi)*(1.);
414 
415  case 7:
416  return .5*(1. - xi)*(-2.*eta);
417 
418  default:
419  libmesh_error_msg("Invalid shape function index i = " << i);
420  }
421 
422  default:
423  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
424  }
425  }
426 
427  case QUAD9:
428  {
429  // Compute quad shape functions as a tensor-product
430  const Real xi = p(0);
431  const Real eta = p(1);
432 
433  libmesh_assert_less (i, 9);
434 
435  // 0 1 2 3 4 5 6 7 8
436  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
437  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
438 
439  switch (j)
440  {
441  // d()/dxi
442  case 0:
443  return (FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
444  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta));
445 
446  // d()/deta
447  case 1:
448  return (FE<1,LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
449  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta));
450 
451  default:
452  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
453  }
454  }
455 
456  case TRI6:
457  {
458  libmesh_assert_less (i, 6);
459 
460  const Real zeta1 = p(0);
461  const Real zeta2 = p(1);
462  const Real zeta0 = 1. - zeta1 - zeta2;
463 
464  const Real dzeta0dxi = -1.;
465  const Real dzeta1dxi = 1.;
466  const Real dzeta2dxi = 0.;
467 
468  const Real dzeta0deta = -1.;
469  const Real dzeta1deta = 0.;
470  const Real dzeta2deta = 1.;
471 
472  switch(j)
473  {
474  case 0:
475  {
476  switch(i)
477  {
478  case 0:
479  return (4.*zeta0-1.)*dzeta0dxi;
480 
481  case 1:
482  return (4.*zeta1-1.)*dzeta1dxi;
483 
484  case 2:
485  return (4.*zeta2-1.)*dzeta2dxi;
486 
487  case 3:
488  return 4.*zeta1*dzeta0dxi + 4.*zeta0*dzeta1dxi;
489 
490  case 4:
491  return 4.*zeta2*dzeta1dxi + 4.*zeta1*dzeta2dxi;
492 
493  case 5:
494  return 4.*zeta2*dzeta0dxi + 4*zeta0*dzeta2dxi;
495 
496  default:
497  libmesh_error_msg("Invalid shape function index i = " << i);
498  }
499  }
500 
501  case 1:
502  {
503  switch(i)
504  {
505  case 0:
506  return (4.*zeta0-1.)*dzeta0deta;
507 
508  case 1:
509  return (4.*zeta1-1.)*dzeta1deta;
510 
511  case 2:
512  return (4.*zeta2-1.)*dzeta2deta;
513 
514  case 3:
515  return 4.*zeta1*dzeta0deta + 4.*zeta0*dzeta1deta;
516 
517  case 4:
518  return 4.*zeta2*dzeta1deta + 4.*zeta1*dzeta2deta;
519 
520  case 5:
521  return 4.*zeta2*dzeta0deta + 4*zeta0*dzeta2deta;
522 
523  default:
524  libmesh_error_msg("Invalid shape function index i = " << i);
525  }
526  }
527  default:
528  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
529  }
530  }
531 
532  default:
533  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
534  }
535  }
536 
537  // unsupported order
538  default:
539  libmesh_error_msg("ERROR: Unsupported 2D FE order: " << order);
540  }
541 
542 
543  libmesh_error_msg("We'll never get here!");
544 #endif // LIBMESH_DIM > 1
545  return 0.;
546 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, L2_LAGRANGE >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 224 of file fe_l2_lagrange_shape_2D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::FIRST, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::Real, libMesh::SECOND, libMesh::TRI3, libMesh::TRI6, and libMesh::TRISHELL3.

229 {
230 #if LIBMESH_DIM > 1
231 
232 
233  libmesh_assert_less (j, 2);
234 
235  switch (order)
236  {
237  // linear Lagrange shape functions
238  case FIRST:
239  {
240  switch (type)
241  {
242  case QUAD4:
243  case QUADSHELL4:
244  case QUAD8:
245  case QUAD9:
246  {
247  // Compute quad shape functions as a tensor-product
248  const Real xi = p(0);
249  const Real eta = p(1);
250 
251  libmesh_assert_less (i, 4);
252 
253  // 0 1 2 3
254  static const unsigned int i0[] = {0, 1, 1, 0};
255  static const unsigned int i1[] = {0, 0, 1, 1};
256 
257  switch (j)
258  {
259  // d()/dxi
260  case 0:
261  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
262  FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i1[i], eta));
263 
264  // d()/deta
265  case 1:
266  return (FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i0[i], xi)*
267  FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta));
268 
269  default:
270  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
271  }
272  }
273 
274  case TRI3:
275  case TRISHELL3:
276  case TRI6:
277  {
278  libmesh_assert_less (i, 3);
279 
280  const Real dzeta0dxi = -1.;
281  const Real dzeta1dxi = 1.;
282  const Real dzeta2dxi = 0.;
283 
284  const Real dzeta0deta = -1.;
285  const Real dzeta1deta = 0.;
286  const Real dzeta2deta = 1.;
287 
288  switch (j)
289  {
290  // d()/dxi
291  case 0:
292  {
293  switch(i)
294  {
295  case 0:
296  return dzeta0dxi;
297 
298  case 1:
299  return dzeta1dxi;
300 
301  case 2:
302  return dzeta2dxi;
303 
304  default:
305  libmesh_error_msg("Invalid shape function index i = " << i);
306  }
307  }
308  // d()/deta
309  case 1:
310  {
311  switch(i)
312  {
313  case 0:
314  return dzeta0deta;
315 
316  case 1:
317  return dzeta1deta;
318 
319  case 2:
320  return dzeta2deta;
321 
322  default:
323  libmesh_error_msg("Invalid shape function index i = " << i);
324  }
325  }
326  default:
327  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
328  }
329  }
330 
331  default:
332  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
333  }
334  }
335 
336 
337  // quadratic Lagrange shape functions
338  case SECOND:
339  {
340  switch (type)
341  {
342  case QUAD8:
343  {
344  const Real xi = p(0);
345  const Real eta = p(1);
346 
347  libmesh_assert_less (i, 8);
348 
349  switch (j)
350  {
351  // d/dxi
352  case 0:
353  switch (i)
354  {
355  case 0:
356  return .25*(1. - eta)*((1. - xi)*(-1.) +
357  (-1.)*(-1. - xi - eta));
358 
359  case 1:
360  return .25*(1. - eta)*((1. + xi)*(1.) +
361  (1.)*(-1. + xi - eta));
362 
363  case 2:
364  return .25*(1. + eta)*((1. + xi)*(1.) +
365  (1.)*(-1. + xi + eta));
366 
367  case 3:
368  return .25*(1. + eta)*((1. - xi)*(-1.) +
369  (-1.)*(-1. - xi + eta));
370 
371  case 4:
372  return .5*(-2.*xi)*(1. - eta);
373 
374  case 5:
375  return .5*(1.)*(1. - eta*eta);
376 
377  case 6:
378  return .5*(-2.*xi)*(1. + eta);
379 
380  case 7:
381  return .5*(-1.)*(1. - eta*eta);
382 
383  default:
384  libmesh_error_msg("Invalid shape function index i = " << i);
385  }
386 
387  // d/deta
388  case 1:
389  switch (i)
390  {
391  case 0:
392  return .25*(1. - xi)*((1. - eta)*(-1.) +
393  (-1.)*(-1. - xi - eta));
394 
395  case 1:
396  return .25*(1. + xi)*((1. - eta)*(-1.) +
397  (-1.)*(-1. + xi - eta));
398 
399  case 2:
400  return .25*(1. + xi)*((1. + eta)*(1.) +
401  (1.)*(-1. + xi + eta));
402 
403  case 3:
404  return .25*(1. - xi)*((1. + eta)*(1.) +
405  (1.)*(-1. - xi + eta));
406 
407  case 4:
408  return .5*(1. - xi*xi)*(-1.);
409 
410  case 5:
411  return .5*(1. + xi)*(-2.*eta);
412 
413  case 6:
414  return .5*(1. - xi*xi)*(1.);
415 
416  case 7:
417  return .5*(1. - xi)*(-2.*eta);
418 
419  default:
420  libmesh_error_msg("Invalid shape function index i = " << i);
421  }
422 
423  default:
424  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
425  }
426  }
427 
428  case QUAD9:
429  {
430  // Compute quad shape functions as a tensor-product
431  const Real xi = p(0);
432  const Real eta = p(1);
433 
434  libmesh_assert_less (i, 9);
435 
436  // 0 1 2 3 4 5 6 7 8
437  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
438  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
439 
440  switch (j)
441  {
442  // d()/dxi
443  case 0:
444  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
445  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta));
446 
447  // d()/deta
448  case 1:
449  return (FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
450  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta));
451 
452  default:
453  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
454  }
455  }
456 
457  case TRI6:
458  {
459  libmesh_assert_less (i, 6);
460 
461  const Real zeta1 = p(0);
462  const Real zeta2 = p(1);
463  const Real zeta0 = 1. - zeta1 - zeta2;
464 
465  const Real dzeta0dxi = -1.;
466  const Real dzeta1dxi = 1.;
467  const Real dzeta2dxi = 0.;
468 
469  const Real dzeta0deta = -1.;
470  const Real dzeta1deta = 0.;
471  const Real dzeta2deta = 1.;
472 
473  switch(j)
474  {
475  case 0:
476  {
477  switch(i)
478  {
479  case 0:
480  return (4.*zeta0-1.)*dzeta0dxi;
481 
482  case 1:
483  return (4.*zeta1-1.)*dzeta1dxi;
484 
485  case 2:
486  return (4.*zeta2-1.)*dzeta2dxi;
487 
488  case 3:
489  return 4.*zeta1*dzeta0dxi + 4.*zeta0*dzeta1dxi;
490 
491  case 4:
492  return 4.*zeta2*dzeta1dxi + 4.*zeta1*dzeta2dxi;
493 
494  case 5:
495  return 4.*zeta2*dzeta0dxi + 4*zeta0*dzeta2dxi;
496 
497  default:
498  libmesh_error_msg("Invalid shape function index i = " << i);
499  }
500  }
501 
502  case 1:
503  {
504  switch(i)
505  {
506  case 0:
507  return (4.*zeta0-1.)*dzeta0deta;
508 
509  case 1:
510  return (4.*zeta1-1.)*dzeta1deta;
511 
512  case 2:
513  return (4.*zeta2-1.)*dzeta2deta;
514 
515  case 3:
516  return 4.*zeta1*dzeta0deta + 4.*zeta0*dzeta1deta;
517 
518  case 4:
519  return 4.*zeta2*dzeta1deta + 4.*zeta1*dzeta2deta;
520 
521  case 5:
522  return 4.*zeta2*dzeta0deta + 4*zeta0*dzeta2deta;
523 
524  default:
525  libmesh_error_msg("Invalid shape function index i = " << i);
526  }
527  }
528  default:
529  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
530  }
531  }
532 
533  default:
534  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
535  }
536  }
537 
538 
539 
540  // unsupported order
541  default:
542  libmesh_error_msg("ERROR: Unsupported 2D FE order: " << order);
543  }
544 
545 
546  libmesh_error_msg("We'll never get here!");
547  return 0.;
548 
549 #endif
550 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, L2_LAGRANGE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 225 of file fe_l2_lagrange_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

230 {
231  libmesh_assert(elem);
232 
233  return FE<1,L2_LAGRANGE>::shape_deriv(elem->type(),
234  static_cast<Order>(order + elem->p_level()), i, j, p);
235 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 1, LAGRANGE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 225 of file fe_lagrange_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

230 {
231  libmesh_assert(elem);
232 
233  return FE<1,LAGRANGE>::shape_deriv(elem->type(),
234  static_cast<Order>(order + elem->p_level()), i, j, p);
235 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 2, L2_HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 229 of file fe_l2_hierarchic_shape_2D.C.

234 {
235  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge orientation is needed.");
236  return 0.;
237 }
template<>
Real libMesh::FE< 2, HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 229 of file fe_hierarchic_shape_2D.C.

234 {
235  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge orientation is needed.");
236  return 0.;
237 }
template<>
Real libMesh::FE< 3, XYZ >::shape_deriv ( const Elem elem,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point point_in 
)

Definition at line 236 of file fe_xyz_shape_3D.C.

References std::abs(), libMesh::Elem::centroid(), libMesh::libmesh_assert(), std::max(), libMesh::Elem::n_nodes(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::Real, and libMesh::x.

241 {
242 #if LIBMESH_DIM == 3
243 
244  libmesh_assert(elem);
245  libmesh_assert_less (j, 3);
246 
247  Point centroid = elem->centroid();
248  Point max_distance = Point(0.,0.,0.);
249  for (unsigned int p = 0; p < elem->n_nodes(); p++)
250  for (unsigned int d = 0; d < 3; d++)
251  {
252  const Real distance = std::abs(centroid(d) - elem->point(p)(d));
253  max_distance(d) = std::max(distance, max_distance(d));
254  }
255 
256  const Real x = point_in(0);
257  const Real y = point_in(1);
258  const Real z = point_in(2);
259  const Real xc = centroid(0);
260  const Real yc = centroid(1);
261  const Real zc = centroid(2);
262  const Real distx = max_distance(0);
263  const Real disty = max_distance(1);
264  const Real distz = max_distance(2);
265  const Real dx = (x - xc)/distx;
266  const Real dy = (y - yc)/disty;
267  const Real dz = (z - zc)/distz;
268 
269 #ifndef NDEBUG
270  // totalorder is only used in the assertion below, so
271  // we avoid declaring it when asserts are not active.
272  const unsigned int totalorder = static_cast<Order>(order + elem->p_level());
273 #endif
274  libmesh_assert_less (i, (static_cast<unsigned int>(totalorder)+1)*
275  (static_cast<unsigned int>(totalorder)+2)*
276  (static_cast<unsigned int>(totalorder)+3)/6);
277 
278  switch (j)
279  {
280  // d()/dx
281  case 0:
282  {
283  switch (i)
284  {
285  // constant
286  case 0:
287  return 0.;
288 
289  // linear
290  case 1:
291  return 1./distx;
292 
293  case 2:
294  return 0.;
295 
296  case 3:
297  return 0.;
298 
299  // quadratic
300  case 4:
301  return 2.*dx/distx;
302 
303  case 5:
304  return dy/distx;
305 
306  case 6:
307  return 0.;
308 
309  case 7:
310  return dz/distx;
311 
312  case 8:
313  return 0.;
314 
315  case 9:
316  return 0.;
317 
318  // cubic
319  case 10:
320  return 3.*dx*dx/distx;
321 
322  case 11:
323  return 2.*dx*dy/distx;
324 
325  case 12:
326  return dy*dy/distx;
327 
328  case 13:
329  return 0.;
330 
331  case 14:
332  return 2.*dx*dz/distx;
333 
334  case 15:
335  return dy*dz/distx;
336 
337  case 16:
338  return 0.;
339 
340  case 17:
341  return dz*dz/distx;
342 
343  case 18:
344  return 0.;
345 
346  case 19:
347  return 0.;
348 
349  // quartics
350  case 20:
351  return 4.*dx*dx*dx/distx;
352 
353  case 21:
354  return 3.*dx*dx*dy/distx;
355 
356  case 22:
357  return 2.*dx*dy*dy/distx;
358 
359  case 23:
360  return dy*dy*dy/distx;
361 
362  case 24:
363  return 0.;
364 
365  case 25:
366  return 3.*dx*dx*dz/distx;
367 
368  case 26:
369  return 2.*dx*dy*dz/distx;
370 
371  case 27:
372  return dy*dy*dz/distx;
373 
374  case 28:
375  return 0.;
376 
377  case 29:
378  return 2.*dx*dz*dz/distx;
379 
380  case 30:
381  return dy*dz*dz/distx;
382 
383  case 31:
384  return 0.;
385 
386  case 32:
387  return dz*dz*dz/distx;
388 
389  case 33:
390  return 0.;
391 
392  case 34:
393  return 0.;
394 
395  default:
396  unsigned int o = 0;
397  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
398  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
399  unsigned int block=o, nz = 0;
400  for (; block < i2; block += (o-nz+1)) { nz++; }
401  const unsigned int nx = block - i2;
402  const unsigned int ny = o - nx - nz;
403  Real val = nx;
404  for (unsigned int index=1; index < nx; index++)
405  val *= dx;
406  for (unsigned int index=0; index != ny; index++)
407  val *= dy;
408  for (unsigned int index=0; index != nz; index++)
409  val *= dz;
410  return val/distx;
411  }
412  }
413 
414 
415  // d()/dy
416  case 1:
417  {
418  switch (i)
419  {
420  // constant
421  case 0:
422  return 0.;
423 
424  // linear
425  case 1:
426  return 0.;
427 
428  case 2:
429  return 1./disty;
430 
431  case 3:
432  return 0.;
433 
434  // quadratic
435  case 4:
436  return 0.;
437 
438  case 5:
439  return dx/disty;
440 
441  case 6:
442  return 2.*dy/disty;
443 
444  case 7:
445  return 0.;
446 
447  case 8:
448  return dz/disty;
449 
450  case 9:
451  return 0.;
452 
453  // cubic
454  case 10:
455  return 0.;
456 
457  case 11:
458  return dx*dx/disty;
459 
460  case 12:
461  return 2.*dx*dy/disty;
462 
463  case 13:
464  return 3.*dy*dy/disty;
465 
466  case 14:
467  return 0.;
468 
469  case 15:
470  return dx*dz/disty;
471 
472  case 16:
473  return 2.*dy*dz/disty;
474 
475  case 17:
476  return 0.;
477 
478  case 18:
479  return dz*dz/disty;
480 
481  case 19:
482  return 0.;
483 
484  // quartics
485  case 20:
486  return 0.;
487 
488  case 21:
489  return dx*dx*dx/disty;
490 
491  case 22:
492  return 2.*dx*dx*dy/disty;
493 
494  case 23:
495  return 3.*dx*dy*dy/disty;
496 
497  case 24:
498  return 4.*dy*dy*dy/disty;
499 
500  case 25:
501  return 0.;
502 
503  case 26:
504  return dx*dx*dz/disty;
505 
506  case 27:
507  return 2.*dx*dy*dz/disty;
508 
509  case 28:
510  return 3.*dy*dy*dz/disty;
511 
512  case 29:
513  return 0.;
514 
515  case 30:
516  return dx*dz*dz/disty;
517 
518  case 31:
519  return 2.*dy*dz*dz/disty;
520 
521  case 32:
522  return 0.;
523 
524  case 33:
525  return dz*dz*dz/disty;
526 
527  case 34:
528  return 0.;
529 
530  default:
531  unsigned int o = 0;
532  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
533  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
534  unsigned int block=o, nz = 0;
535  for (; block < i2; block += (o-nz+1)) { nz++; }
536  const unsigned int nx = block - i2;
537  const unsigned int ny = o - nx - nz;
538  Real val = ny;
539  for (unsigned int index=0; index != nx; index++)
540  val *= dx;
541  for (unsigned int index=1; index < ny; index++)
542  val *= dy;
543  for (unsigned int index=0; index != nz; index++)
544  val *= dz;
545  return val/disty;
546  }
547  }
548 
549 
550  // d()/dz
551  case 2:
552  {
553  switch (i)
554  {
555  // constant
556  case 0:
557  return 0.;
558 
559  // linear
560  case 1:
561  return 0.;
562 
563  case 2:
564  return 0.;
565 
566  case 3:
567  return 1./distz;
568 
569  // quadratic
570  case 4:
571  return 0.;
572 
573  case 5:
574  return 0.;
575 
576  case 6:
577  return 0.;
578 
579  case 7:
580  return dx/distz;
581 
582  case 8:
583  return dy/distz;
584 
585  case 9:
586  return 2.*dz/distz;
587 
588  // cubic
589  case 10:
590  return 0.;
591 
592  case 11:
593  return 0.;
594 
595  case 12:
596  return 0.;
597 
598  case 13:
599  return 0.;
600 
601  case 14:
602  return dx*dx/distz;
603 
604  case 15:
605  return dx*dy/distz;
606 
607  case 16:
608  return dy*dy/distz;
609 
610  case 17:
611  return 2.*dx*dz/distz;
612 
613  case 18:
614  return 2.*dy*dz/distz;
615 
616  case 19:
617  return 3.*dz*dz/distz;
618 
619  // quartics
620  case 20:
621  return 0.;
622 
623  case 21:
624  return 0.;
625 
626  case 22:
627  return 0.;
628 
629  case 23:
630  return 0.;
631 
632  case 24:
633  return 0.;
634 
635  case 25:
636  return dx*dx*dx/distz;
637 
638  case 26:
639  return dx*dx*dy/distz;
640 
641  case 27:
642  return dx*dy*dy/distz;
643 
644  case 28:
645  return dy*dy*dy/distz;
646 
647  case 29:
648  return 2.*dx*dx*dz/distz;
649 
650  case 30:
651  return 2.*dx*dy*dz/distz;
652 
653  case 31:
654  return 2.*dy*dy*dz/distz;
655 
656  case 32:
657  return 3.*dx*dz*dz/distz;
658 
659  case 33:
660  return 3.*dy*dz*dz/distz;
661 
662  case 34:
663  return 4.*dz*dz*dz/distz;
664 
665  default:
666  unsigned int o = 0;
667  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
668  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
669  unsigned int block=o, nz = 0;
670  for (; block < i2; block += (o-nz+1)) { nz++; }
671  const unsigned int nx = block - i2;
672  const unsigned int ny = o - nx - nz;
673  Real val = nz;
674  for (unsigned int index=0; index != nx; index++)
675  val *= dx;
676  for (unsigned int index=0; index != ny; index++)
677  val *= dy;
678  for (unsigned int index=1; index < nz; index++)
679  val *= dz;
680  return val/distz;
681  }
682  }
683 
684 
685  default:
686  libmesh_error_msg("Invalid j = " << j);
687  }
688 
689 #endif
690 
691  libmesh_error_msg("We'll never get here!");
692  return 0.;
693 }
double abs(double a)
libmesh_assert(remote_elem)
long double max(long double a, double b)
PetscErrorCode Vec x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, L2_HIERARCHIC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 242 of file fe_l2_hierarchic_shape_2D.C.

References libMesh::EDGE3, libMesh::libmesh_assert(), libMesh::libmesh_assert_greater(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::Real, libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::square_number_column, libMesh::square_number_row, libMesh::TRI3, libMesh::TRI6, libMesh::TRISHELL3, and libMesh::Elem::type().

247 {
248  libmesh_assert(elem);
249 
250  const ElemType type = elem->type();
251 
252  const Order totalorder = static_cast<Order>(order+elem->p_level());
253 
254  libmesh_assert_greater (totalorder, 0);
255 
256  switch (type)
257  {
258  // 1st & 2nd-order Hierarchics.
259  case TRI3:
260  case TRISHELL3:
261  case TRI6:
262  {
263  const Real eps = 1.e-6;
264 
265  libmesh_assert_less (j, 2);
266 
267  switch (j)
268  {
269  // d()/dxi
270  case 0:
271  {
272  const Point pp(p(0)+eps, p(1));
273  const Point pm(p(0)-eps, p(1));
274 
275  return (FE<2,L2_HIERARCHIC>::shape(elem, order, i, pp) -
276  FE<2,L2_HIERARCHIC>::shape(elem, order, i, pm))/2./eps;
277  }
278 
279  // d()/deta
280  case 1:
281  {
282  const Point pp(p(0), p(1)+eps);
283  const Point pm(p(0), p(1)-eps);
284 
285  return (FE<2,L2_HIERARCHIC>::shape(elem, order, i, pp) -
286  FE<2,L2_HIERARCHIC>::shape(elem, order, i, pm))/2./eps;
287  }
288 
289 
290  default:
291  libmesh_error_msg("Invalid derivative index j = " << j);
292  }
293  }
294 
295  case QUAD4:
296  case QUADSHELL4:
297  libmesh_assert_less (totalorder, 2);
298  case QUAD8:
299  case QUAD9:
300  {
301  // Compute quad shape functions as a tensor-product
302  const Real xi = p(0);
303  const Real eta = p(1);
304 
305  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
306 
307  // Example i, i0, i1 values for totalorder = 5:
308  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
309  // static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 0, 0, 0, 0, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5};
310  // static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5};
311 
312  unsigned int i0, i1;
313 
314  // Vertex DoFs
315  if (i == 0)
316  { i0 = 0; i1 = 0; }
317  else if (i == 1)
318  { i0 = 1; i1 = 0; }
319  else if (i == 2)
320  { i0 = 1; i1 = 1; }
321  else if (i == 3)
322  { i0 = 0; i1 = 1; }
323  // Edge DoFs
324  else if (i < totalorder + 3u)
325  { i0 = i - 2; i1 = 0; }
326  else if (i < 2u*totalorder + 2)
327  { i0 = 1; i1 = i - totalorder - 1; }
328  else if (i < 3u*totalorder + 1u)
329  { i0 = i - 2u*totalorder; i1 = 1; }
330  else if (i < 4u*totalorder)
331  { i0 = 0; i1 = i - 3u*totalorder + 1; }
332  // Interior DoFs
333  else
334  {
335  unsigned int basisnum = i - 4*totalorder;
336  i0 = square_number_column[basisnum] + 2;
337  i1 = square_number_row[basisnum] + 2;
338  }
339 
340  // Flip odd degree of freedom values if necessary
341  // to keep continuity on sides
342  Real f = 1.;
343 
344  if ((i0%2) && (i0 > 2) && (i1 == 0))
345  f = (elem->point(0) > elem->point(1))?-1.:1.;
346  else if ((i0%2) && (i0>2) && (i1 == 1))
347  f = (elem->point(3) > elem->point(2))?-1.:1.;
348  else if ((i0 == 0) && (i1%2) && (i1>2))
349  f = (elem->point(0) > elem->point(3))?-1.:1.;
350  else if ((i0 == 1) && (i1%2) && (i1>2))
351  f = (elem->point(1) > elem->point(2))?-1.:1.;
352 
353  switch (j)
354  {
355  // d()/dxi
356  case 0:
357  return f*(FE<1,L2_HIERARCHIC>::shape_deriv(EDGE3, totalorder, i0, 0, xi)*
358  FE<1,L2_HIERARCHIC>::shape (EDGE3, totalorder, i1, eta));
359 
360  // d()/deta
361  case 1:
362  return f*(FE<1,L2_HIERARCHIC>::shape (EDGE3, totalorder, i0, xi)*
363  FE<1,L2_HIERARCHIC>::shape_deriv(EDGE3, totalorder, i1, 0, eta));
364 
365  default:
366  libmesh_error_msg("Invalid derivative index j = " << j);
367  }
368  }
369 
370  default:
371  libmesh_error_msg("ERROR: Unsupported element type = " << type);
372  }
373 
374  return 0.;
375 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
const unsigned char square_number_column[]
libmesh_assert_greater(libMeshPrivateData::_n_processors, 0)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned char square_number_row[]
template<>
Real libMesh::FE< 2, HIERARCHIC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 242 of file fe_hierarchic_shape_2D.C.

References libMesh::EDGE3, libMesh::libmesh_assert(), libMesh::libmesh_assert_greater(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::Real, libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::square_number_column, libMesh::square_number_row, libMesh::TRI3, libMesh::TRI6, libMesh::TRISHELL3, and libMesh::Elem::type().

247 {
248  libmesh_assert(elem);
249 
250  const ElemType type = elem->type();
251 
252  const Order totalorder = static_cast<Order>(order+elem->p_level());
253 
254  libmesh_assert_greater (totalorder, 0);
255 
256  switch (type)
257  {
258  // 1st & 2nd-order Hierarchics.
259  case TRI3:
260  case TRISHELL3:
261  case TRI6:
262  {
263  const Real eps = 1.e-6;
264 
265  libmesh_assert_less (j, 2);
266 
267  switch (j)
268  {
269  // d()/dxi
270  case 0:
271  {
272  const Point pp(p(0)+eps, p(1));
273  const Point pm(p(0)-eps, p(1));
274 
275  return (FE<2,HIERARCHIC>::shape(elem, order, i, pp) -
276  FE<2,HIERARCHIC>::shape(elem, order, i, pm))/2./eps;
277  }
278 
279  // d()/deta
280  case 1:
281  {
282  const Point pp(p(0), p(1)+eps);
283  const Point pm(p(0), p(1)-eps);
284 
285  return (FE<2,HIERARCHIC>::shape(elem, order, i, pp) -
286  FE<2,HIERARCHIC>::shape(elem, order, i, pm))/2./eps;
287  }
288 
289  default:
290  libmesh_error_msg("Invalid derivative index j = " << j);
291  }
292  }
293 
294  case QUAD4:
295  case QUADSHELL4:
296  libmesh_assert_less (totalorder, 2);
297  case QUAD8:
298  case QUAD9:
299  {
300  // Compute quad shape functions as a tensor-product
301  const Real xi = p(0);
302  const Real eta = p(1);
303 
304  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
305 
306  // Example i, i0, i1 values for totalorder = 5:
307  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
308  // static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 0, 0, 0, 0, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5};
309  // static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5};
310 
311  unsigned int i0, i1;
312 
313  // Vertex DoFs
314  if (i == 0)
315  { i0 = 0; i1 = 0; }
316  else if (i == 1)
317  { i0 = 1; i1 = 0; }
318  else if (i == 2)
319  { i0 = 1; i1 = 1; }
320  else if (i == 3)
321  { i0 = 0; i1 = 1; }
322  // Edge DoFs
323  else if (i < totalorder + 3u)
324  { i0 = i - 2; i1 = 0; }
325  else if (i < 2u*totalorder + 2)
326  { i0 = 1; i1 = i - totalorder - 1; }
327  else if (i < 3u*totalorder + 1u)
328  { i0 = i - 2u*totalorder; i1 = 1; }
329  else if (i < 4u*totalorder)
330  { i0 = 0; i1 = i - 3u*totalorder + 1; }
331  // Interior DoFs
332  else
333  {
334  unsigned int basisnum = i - 4*totalorder;
335  i0 = square_number_column[basisnum] + 2;
336  i1 = square_number_row[basisnum] + 2;
337  }
338 
339  // Flip odd degree of freedom values if necessary
340  // to keep continuity on sides
341  Real f = 1.;
342 
343  if ((i0%2) && (i0 > 2) && (i1 == 0))
344  f = (elem->point(0) > elem->point(1))?-1.:1.;
345  else if ((i0%2) && (i0>2) && (i1 == 1))
346  f = (elem->point(3) > elem->point(2))?-1.:1.;
347  else if ((i0 == 0) && (i1%2) && (i1>2))
348  f = (elem->point(0) > elem->point(3))?-1.:1.;
349  else if ((i0 == 1) && (i1%2) && (i1>2))
350  f = (elem->point(1) > elem->point(2))?-1.:1.;
351 
352  switch (j)
353  {
354  // d()/dxi
355  case 0:
356  return f*(FE<1,HIERARCHIC>::shape_deriv(EDGE3, totalorder, i0, 0, xi)*
357  FE<1,HIERARCHIC>::shape (EDGE3, totalorder, i1, eta));
358 
359  // d()/deta
360  case 1:
361  return f*(FE<1,HIERARCHIC>::shape (EDGE3, totalorder, i0, xi)*
362  FE<1,HIERARCHIC>::shape_deriv(EDGE3, totalorder, i1, 0, eta));
363 
364  default:
365  libmesh_error_msg("Invalid derivative index j = " << j);
366  }
367  }
368 
369  default:
370  libmesh_error_msg("ERROR: Unsupported element type = " << type);
371  }
372 
373  return 0.;
374 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
const unsigned char square_number_column[]
libmesh_assert_greater(libMeshPrivateData::_n_processors, 0)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned char square_number_row[]
template<>
Real libMesh::FE< 1, HERMITE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 249 of file fe_hermite_shape_1D.C.

254 {
255  libmesh_error_msg("Hermite elements require the real element \nto construct gradient-based degrees of freedom.");
256  return 0.;
257 }
template<>
Real libMesh::FE< 2, HERMITE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 252 of file fe_hermite_shape_2D.C.

257 {
258  libmesh_error_msg("Hermite elements require the real element \nto construct gradient-based degrees of freedom.");
259  return 0.;
260 }
template<>
Real libMesh::FE< 1, HERMITE >::shape_deriv ( const Elem elem,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned  int,
const Point p 
)

Definition at line 262 of file fe_hermite_shape_1D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::FEHermite< Dim >::hermite_raw_shape_deriv(), libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Real, and libMesh::Elem::type().

267 {
268  libmesh_assert(elem);
269 
270  // Coefficient naming: d(1)d(2n) is the coefficient of the
271  // global shape function corresponding to value 1 in terms of the
272  // local shape function corresponding to normal derivative 2
273  Real d1xd1x, d2xd2x;
274 
275  hermite_compute_coefs(elem, d1xd1x, d2xd2x);
276 
277  const ElemType type = elem->type();
278 
279 #ifndef NDEBUG
280  const unsigned int totalorder = order + elem->p_level();
281 #endif
282 
283  switch (type)
284  {
285  // C1 functions on the C1 cubic edge
286  case EDGE2:
287  case EDGE3:
288  {
289  libmesh_assert_less (i, totalorder+1);
290 
291  switch (i)
292  {
293  case 0:
295  case 1:
296  return d1xd1x * FEHermite<1>::hermite_raw_shape_deriv(2, p(0));
297  case 2:
299  case 3:
300  return d2xd2x * FEHermite<1>::hermite_raw_shape_deriv(3, p(0));
301  default:
303  }
304  }
305  default:
306  libmesh_error_msg("ERROR: Unsupported element type = " << type);
307  }
308 
309  libmesh_error_msg("We'll never get here!");
310  return 0.;
311 }
libmesh_assert(remote_elem)
unsigned int p_level() const
Definition: elem.h:2141
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static Real hermite_raw_shape_deriv(const unsigned int basis_num, const Real xi)
virtual ElemType type() const =0
template<>
Real libMesh::FE< 2, HERMITE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 265 of file fe_hermite_shape_2D.C.

References libMesh::FEHermite< Dim >::hermite_raw_shape(), libMesh::FEHermite< Dim >::hermite_raw_shape_deriv(), libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::Real, and libMesh::Elem::type().

270 {
271  libmesh_assert(elem);
272  libmesh_assert (j == 0 || j == 1);
273 
274  std::vector<std::vector<Real> > dxdxi(2, std::vector<Real>(2, 0));
275 
276 #ifdef DEBUG
277  std::vector<Real> dxdeta(2), dydxi(2);
278 #endif
279 
280  hermite_compute_coefs(elem,dxdxi
281 #ifdef DEBUG
282  ,dxdeta,dydxi
283 #endif
284  );
285 
286  const ElemType type = elem->type();
287 
288  const Order totalorder = static_cast<Order>(order + elem->p_level());
289 
290  switch (type)
291  {
292  case QUAD4:
293  case QUADSHELL4:
294  libmesh_assert_less (totalorder, 4);
295  case QUAD8:
296  case QUAD9:
297  {
298  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
299 
300  std::vector<unsigned int> bases1D;
301 
302  Real coef = hermite_bases_2D(bases1D, dxdxi, totalorder, i);
303 
304  switch (j)
305  {
306  case 0:
307  return coef *
308  FEHermite<1>::hermite_raw_shape_deriv(bases1D[0],p(0)) *
309  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1));
310  case 1:
311  return coef *
312  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
313  FEHermite<1>::hermite_raw_shape_deriv(bases1D[1],p(1));
314  default:
315  libmesh_error_msg("Invalid derivative index j = " << j);
316  }
317  }
318  default:
319  libmesh_error_msg("ERROR: Unsupported element type = " << type);
320  }
321 
322  libmesh_error_msg("We'll never get here!");
323  return 0.;
324 }
libmesh_assert(remote_elem)
unsigned int p_level() const
Definition: elem.h:2141
static Real hermite_raw_shape(const unsigned int basis_num, const Real xi)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static Real hermite_raw_shape_deriv(const unsigned int basis_num, const Real xi)
virtual ElemType type() const =0
template<>
Real libMesh::FE< 1, CLOUGH >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 281 of file fe_clough_shape_1D.C.

286 {
287  libmesh_error_msg("Clough-Tocher elements require the real element \nto construct gradient-based degrees of freedom.");
288  return 0.;
289 }
template<>
Real libMesh::FE< 1, CLOUGH >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 294 of file fe_clough_shape_1D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::THIRD, and libMesh::Elem::type().

299 {
300  libmesh_assert(elem);
301 
302  clough_compute_coefs(elem);
303 
304  const ElemType type = elem->type();
305 
306  const Order totalorder = static_cast<Order>(order + elem->p_level());
307 
308  switch (totalorder)
309  {
310  // 3rd-order C1 cubic element
311  case THIRD:
312  {
313  switch (type)
314  {
315  // C1 functions on the C1 cubic edge
316  case EDGE2:
317  case EDGE3:
318  {
319  switch (i)
320  {
321  case 0:
322  return clough_raw_shape_deriv(0, j, p);
323  case 1:
324  return clough_raw_shape_deriv(1, j, p);
325  case 2:
326  return d1xd1x * clough_raw_shape_deriv(2, j, p);
327  case 3:
328  return d2xd2x * clough_raw_shape_deriv(3, j, p);
329  default:
330  libmesh_error_msg("Invalid shape function index i = " << i);
331  }
332  }
333  default:
334  libmesh_error_msg("ERROR: Unsupported element type = " << type);
335  }
336  }
337  // by default throw an error
338  default:
339  libmesh_error_msg("ERROR: Unsupported polynomial order = " << totalorder);
340  }
341 
342  libmesh_error_msg("We'll never get here!");
343  return 0.;
344 }
libmesh_assert(remote_elem)
unsigned int p_level() const
Definition: elem.h:2141
virtual ElemType type() const =0
template<>
Real libMesh::FE< 2, MONOMIAL >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 306 of file fe_monomial_shape_2D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

311 {
312  libmesh_assert(elem);
313 
314  // by default call the orientation-independent shape functions
315  return FE<2,MONOMIAL>::shape_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
316 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 1, BERNSTEIN >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 365 of file fe_bernstein_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

370 {
371  libmesh_assert(elem);
372 
373  return FE<1,BERNSTEIN>::shape_deriv(elem->type(),
374  static_cast<Order>(order + elem->p_level()), i, j, p);
375 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 3, L2_LAGRANGE >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 374 of file fe_l2_lagrange_shape_3D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::FIRST, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID5, libMesh::Real, libMesh::SECOND, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, and libMesh::x.

379 {
380 #if LIBMESH_DIM == 3
381 
382  libmesh_assert_less (j, 3);
383 
384  switch (order)
385  {
386  // linear Lagrange shape functions
387  case FIRST:
388  {
389  switch (type)
390  {
391  // trilinear hexahedral shape functions
392  case HEX8:
393  case HEX20:
394  case HEX27:
395  {
396  libmesh_assert_less (i, 8);
397 
398  // Compute hex shape functions as a tensor-product
399  const Real xi = p(0);
400  const Real eta = p(1);
401  const Real zeta = p(2);
402 
403  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
404  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
405  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
406 
407  switch(j)
408  {
409  case 0:
410  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
411  FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i1[i], eta)*
412  FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i2[i], zeta));
413 
414  case 1:
415  return (FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i0[i], xi)*
416  FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta)*
417  FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i2[i], zeta));
418 
419  case 2:
420  return (FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i0[i], xi)*
421  FE<1,L2_LAGRANGE>::shape (EDGE2, FIRST, i1[i], eta)*
422  FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i2[i], 0, zeta));
423 
424  default:
425  libmesh_error_msg("Invalid j = " << j);
426  }
427  }
428 
429  // linear tetrahedral shape functions
430  case TET4:
431  case TET10:
432  {
433  libmesh_assert_less (i, 4);
434 
435  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
436  const Real dzeta0dxi = -1.;
437  const Real dzeta1dxi = 1.;
438  const Real dzeta2dxi = 0.;
439  const Real dzeta3dxi = 0.;
440 
441  const Real dzeta0deta = -1.;
442  const Real dzeta1deta = 0.;
443  const Real dzeta2deta = 1.;
444  const Real dzeta3deta = 0.;
445 
446  const Real dzeta0dzeta = -1.;
447  const Real dzeta1dzeta = 0.;
448  const Real dzeta2dzeta = 0.;
449  const Real dzeta3dzeta = 1.;
450 
451  switch (j)
452  {
453  // d()/dxi
454  case 0:
455  {
456  switch(i)
457  {
458  case 0:
459  return dzeta0dxi;
460 
461  case 1:
462  return dzeta1dxi;
463 
464  case 2:
465  return dzeta2dxi;
466 
467  case 3:
468  return dzeta3dxi;
469 
470  default:
471  libmesh_error_msg("Invalid i = " << i);
472  }
473  }
474 
475  // d()/deta
476  case 1:
477  {
478  switch(i)
479  {
480  case 0:
481  return dzeta0deta;
482 
483  case 1:
484  return dzeta1deta;
485 
486  case 2:
487  return dzeta2deta;
488 
489  case 3:
490  return dzeta3deta;
491 
492  default:
493  libmesh_error_msg("Invalid i = " << i);
494  }
495  }
496 
497  // d()/dzeta
498  case 2:
499  {
500  switch(i)
501  {
502  case 0:
503  return dzeta0dzeta;
504 
505  case 1:
506  return dzeta1dzeta;
507 
508  case 2:
509  return dzeta2dzeta;
510 
511  case 3:
512  return dzeta3dzeta;
513 
514  default:
515  libmesh_error_msg("Invalid i = " << i);
516  }
517  }
518 
519  default:
520  libmesh_error_msg("Invalid shape function derivative j = " << j);
521  }
522  }
523 
524  // linear prism shape functions
525  case PRISM6:
526  case PRISM15:
527  case PRISM18:
528  {
529  libmesh_assert_less (i, 6);
530 
531  // Compute prism shape functions as a tensor-product
532  // of a triangle and an edge
533 
534  Point p2d(p(0),p(1));
535  Point p1d(p(2));
536 
537  // 0 1 2 3 4 5
538  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1};
539  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2};
540 
541  switch (j)
542  {
543  // d()/dxi
544  case 0:
545  return (FE<2,L2_LAGRANGE>::shape_deriv(TRI3, FIRST, i1[i], 0, p2d)*
546  FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i0[i], p1d));
547 
548  // d()/deta
549  case 1:
550  return (FE<2,L2_LAGRANGE>::shape_deriv(TRI3, FIRST, i1[i], 1, p2d)*
551  FE<1,L2_LAGRANGE>::shape(EDGE2, FIRST, i0[i], p1d));
552 
553  // d()/dzeta
554  case 2:
555  return (FE<2,L2_LAGRANGE>::shape(TRI3, FIRST, i1[i], p2d)*
556  FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, p1d));
557 
558  default:
559  libmesh_error_msg("Invalid shape function derivative j = " << j);
560  }
561  }
562 
563  // linear pyramid shape functions
564  case PYRAMID5:
565  {
566  libmesh_assert_less (i, 5);
567 
568  const Real xi = p(0);
569  const Real eta = p(1);
570  const Real zeta = p(2);
571  const Real eps = 1.e-35;
572 
573  switch (j)
574  {
575  // d/dxi
576  case 0:
577  switch(i)
578  {
579  case 0:
580  return .25*(zeta + eta - 1.)/((1. - zeta) + eps);
581 
582  case 1:
583  return -.25*(zeta + eta - 1.)/((1. - zeta) + eps);
584 
585  case 2:
586  return -.25*(zeta - eta - 1.)/((1. - zeta) + eps);
587 
588  case 3:
589  return .25*(zeta - eta - 1.)/((1. - zeta) + eps);
590 
591  case 4:
592  return 0;
593 
594  default:
595  libmesh_error_msg("Invalid i = " << i);
596  }
597 
598 
599  // d/deta
600  case 1:
601  switch(i)
602  {
603  case 0:
604  return .25*(zeta + xi - 1.)/((1. - zeta) + eps);
605 
606  case 1:
607  return .25*(zeta - xi - 1.)/((1. - zeta) + eps);
608 
609  case 2:
610  return -.25*(zeta - xi - 1.)/((1. - zeta) + eps);
611 
612  case 3:
613  return -.25*(zeta + xi - 1.)/((1. - zeta) + eps);
614 
615  case 4:
616  return 0;
617 
618  default:
619  libmesh_error_msg("Invalid i = " << i);
620  }
621 
622 
623  // d/dzeta
624  case 2:
625  switch(i)
626  {
627  case 0:
628  {
629  const Real a=1.;
630  const Real b=1.;
631 
632  return .25*(((zeta + a*xi - 1.)*(zeta + b*eta - 1.) +
633  (1. - zeta)*((zeta + a*xi -1.) + (zeta + b*eta - 1.)))/
634  ((1. - zeta)*(1. - zeta) + eps));
635  }
636 
637  case 1:
638  {
639  const Real a=-1.;
640  const Real b=1.;
641 
642  return .25*(((zeta + a*xi - 1.)*(zeta + b*eta - 1.) +
643  (1. - zeta)*((zeta + a*xi -1.) + (zeta + b*eta - 1.)))/
644  ((1. - zeta)*(1. - zeta) + eps));
645  }
646 
647  case 2:
648  {
649  const Real a=-1.;
650  const Real b=-1.;
651 
652  return .25*(((zeta + a*xi - 1.)*(zeta + b*eta - 1.) +
653  (1. - zeta)*((zeta + a*xi -1.) + (zeta + b*eta - 1.)))/
654  ((1. - zeta)*(1. - zeta) + eps));
655  }
656 
657  case 3:
658  {
659  const Real a=1.;
660  const Real b=-1.;
661 
662  return .25*(((zeta + a*xi - 1.)*(zeta + b*eta - 1.) +
663  (1. - zeta)*((zeta + a*xi -1.) + (zeta + b*eta - 1.)))/
664  ((1. - zeta)*(1. - zeta) + eps));
665  }
666 
667  case 4:
668  return 1.;
669 
670  default:
671  libmesh_error_msg("Invalid i = " << i);
672  }
673 
674 
675  default:
676  libmesh_error_msg("Invalid j = " << j);
677  }
678  }
679 
680 
681  default:
682  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
683  }
684  }
685 
686 
687  // quadratic Lagrange shape functions
688  case SECOND:
689  {
690  switch (type)
691  {
692 
693  // serendipity hexahedral quadratic shape functions
694  case HEX20:
695  {
696  libmesh_assert_less (i, 20);
697 
698  const Real xi = p(0);
699  const Real eta = p(1);
700  const Real zeta = p(2);
701 
702  // these functions are defined for (x,y,z) in [0,1]^3
703  // so transform the locations
704  const Real x = .5*(xi + 1.);
705  const Real y = .5*(eta + 1.);
706  const Real z = .5*(zeta + 1.);
707 
708  // and don't forget the chain rule!
709 
710  switch (j)
711  {
712 
713  // d/dx*dx/dxi
714  case 0:
715  switch (i)
716  {
717  case 0:
718  return .5*(1. - y)*(1. - z)*((1. - x)*(-2.) +
719  (-1.)*(1. - 2.*x - 2.*y - 2.*z));
720 
721  case 1:
722  return .5*(1. - y)*(1. - z)*(x*(2.) +
723  (1.)*(2.*x - 2.*y - 2.*z - 1.));
724 
725  case 2:
726  return .5*y*(1. - z)*(x*(2.) +
727  (1.)*(2.*x + 2.*y - 2.*z - 3.));
728 
729  case 3:
730  return .5*y*(1. - z)*((1. - x)*(-2.) +
731  (-1.)*(2.*y - 2.*x - 2.*z - 1.));
732 
733  case 4:
734  return .5*(1. - y)*z*((1. - x)*(-2.) +
735  (-1.)*(2.*z - 2.*x - 2.*y - 1.));
736 
737  case 5:
738  return .5*(1. - y)*z*(x*(2.) +
739  (1.)*(2.*x - 2.*y + 2.*z - 3.));
740 
741  case 6:
742  return .5*y*z*(x*(2.) +
743  (1.)*(2.*x + 2.*y + 2.*z - 5.));
744 
745  case 7:
746  return .5*y*z*((1. - x)*(-2.) +
747  (-1.)*(2.*y - 2.*x + 2.*z - 3.));
748 
749  case 8:
750  return 2.*(1. - y)*(1. - z)*(1. - 2.*x);
751 
752  case 9:
753  return 2.*y*(1. - y)*(1. - z);
754 
755  case 10:
756  return 2.*y*(1. - z)*(1. - 2.*x);
757 
758  case 11:
759  return 2.*y*(1. - y)*(1. - z)*(-1.);
760 
761  case 12:
762  return 2.*(1. - y)*z*(1. - z)*(-1.);
763 
764  case 13:
765  return 2.*(1. - y)*z*(1. - z);
766 
767  case 14:
768  return 2.*y*z*(1. - z);
769 
770  case 15:
771  return 2.*y*z*(1. - z)*(-1.);
772 
773  case 16:
774  return 2.*(1. - y)*z*(1. - 2.*x);
775 
776  case 17:
777  return 2.*y*(1. - y)*z;
778 
779  case 18:
780  return 2.*y*z*(1. - 2.*x);
781 
782  case 19:
783  return 2.*y*(1. - y)*z*(-1.);
784 
785  default:
786  libmesh_error_msg("Invalid i = " << i);
787  }
788 
789 
790  // d/dy*dy/deta
791  case 1:
792  switch (i)
793  {
794  case 0:
795  return .5*(1. - x)*(1. - z)*((1. - y)*(-2.) +
796  (-1.)*(1. - 2.*x - 2.*y - 2.*z));
797 
798  case 1:
799  return .5*x*(1. - z)*((1. - y)*(-2.) +
800  (-1.)*(2.*x - 2.*y - 2.*z - 1.));
801 
802  case 2:
803  return .5*x*(1. - z)*(y*(2.) +
804  (1.)*(2.*x + 2.*y - 2.*z - 3.));
805 
806  case 3:
807  return .5*(1. - x)*(1. - z)*(y*(2.) +
808  (1.)*(2.*y - 2.*x - 2.*z - 1.));
809 
810  case 4:
811  return .5*(1. - x)*z*((1. - y)*(-2.) +
812  (-1.)*(2.*z - 2.*x - 2.*y - 1.));
813 
814  case 5:
815  return .5*x*z*((1. - y)*(-2.) +
816  (-1.)*(2.*x - 2.*y + 2.*z - 3.));
817 
818  case 6:
819  return .5*x*z*(y*(2.) +
820  (1.)*(2.*x + 2.*y + 2.*z - 5.));
821 
822  case 7:
823  return .5*(1. - x)*z*(y*(2.) +
824  (1.)*(2.*y - 2.*x + 2.*z - 3.));
825 
826  case 8:
827  return 2.*x*(1. - x)*(1. - z)*(-1.);
828 
829  case 9:
830  return 2.*x*(1. - z)*(1. - 2.*y);
831 
832  case 10:
833  return 2.*x*(1. - x)*(1. - z);
834 
835  case 11:
836  return 2.*(1. - x)*(1. - z)*(1. - 2.*y);
837 
838  case 12:
839  return 2.*(1. - x)*z*(1. - z)*(-1.);
840 
841  case 13:
842  return 2.*x*z*(1. - z)*(-1.);
843 
844  case 14:
845  return 2.*x*z*(1. - z);
846 
847  case 15:
848  return 2.*(1. - x)*z*(1. - z);
849 
850  case 16:
851  return 2.*x*(1. - x)*z*(-1.);
852 
853  case 17:
854  return 2.*x*z*(1. - 2.*y);
855 
856  case 18:
857  return 2.*x*(1. - x)*z;
858 
859  case 19:
860  return 2.*(1. - x)*z*(1. - 2.*y);
861 
862  default:
863  libmesh_error_msg("Invalid i = " << i);
864  }
865 
866 
867  // d/dz*dz/dzeta
868  case 2:
869  switch (i)
870  {
871  case 0:
872  return .5*(1. - x)*(1. - y)*((1. - z)*(-2.) +
873  (-1.)*(1. - 2.*x - 2.*y - 2.*z));
874 
875  case 1:
876  return .5*x*(1. - y)*((1. - z)*(-2.) +
877  (-1.)*(2.*x - 2.*y - 2.*z - 1.));
878 
879  case 2:
880  return .5*x*y*((1. - z)*(-2.) +
881  (-1.)*(2.*x + 2.*y - 2.*z - 3.));
882 
883  case 3:
884  return .5*(1. - x)*y*((1. - z)*(-2.) +
885  (-1.)*(2.*y - 2.*x - 2.*z - 1.));
886 
887  case 4:
888  return .5*(1. - x)*(1. - y)*(z*(2.) +
889  (1.)*(2.*z - 2.*x - 2.*y - 1.));
890 
891  case 5:
892  return .5*x*(1. - y)*(z*(2.) +
893  (1.)*(2.*x - 2.*y + 2.*z - 3.));
894 
895  case 6:
896  return .5*x*y*(z*(2.) +
897  (1.)*(2.*x + 2.*y + 2.*z - 5.));
898 
899  case 7:
900  return .5*(1. - x)*y*(z*(2.) +
901  (1.)*(2.*y - 2.*x + 2.*z - 3.));
902 
903  case 8:
904  return 2.*x*(1. - x)*(1. - y)*(-1.);
905 
906  case 9:
907  return 2.*x*y*(1. - y)*(-1.);
908 
909  case 10:
910  return 2.*x*(1. - x)*y*(-1.);
911 
912  case 11:
913  return 2.*(1. - x)*y*(1. - y)*(-1.);
914 
915  case 12:
916  return 2.*(1. - x)*(1. - y)*(1. - 2.*z);
917 
918  case 13:
919  return 2.*x*(1. - y)*(1. - 2.*z);
920 
921  case 14:
922  return 2.*x*y*(1. - 2.*z);
923 
924  case 15:
925  return 2.*(1. - x)*y*(1. - 2.*z);
926 
927  case 16:
928  return 2.*x*(1. - x)*(1. - y);
929 
930  case 17:
931  return 2.*x*y*(1. - y);
932 
933  case 18:
934  return 2.*x*(1. - x)*y;
935 
936  case 19:
937  return 2.*(1. - x)*y*(1. - y);
938 
939  default:
940  libmesh_error_msg("Invalid i = " << i);
941  }
942 
943  default:
944  libmesh_error_msg("Invalid shape function derivative j = " << j);
945  }
946  }
947 
948  // triquadraic hexahedral shape funcions
949  case HEX27:
950  {
951  libmesh_assert_less (i, 27);
952 
953  // Compute hex shape functions as a tensor-product
954  const Real xi = p(0);
955  const Real eta = p(1);
956  const Real zeta = p(2);
957 
958  // The only way to make any sense of this
959  // is to look at the mgflo/mg2/mgf documentation
960  // and make the cut-out cube!
961  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
962  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
963  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
964  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
965 
966  switch(j)
967  {
968  case 0:
969  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
970  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
971  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
972 
973  case 1:
974  return (FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
975  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta)*
976  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
977 
978  case 2:
979  return (FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
980  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
981  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i2[i], 0, zeta));
982 
983  default:
984  libmesh_error_msg("Invalid j = " << j);
985  }
986  }
987 
988  // quadratic tetrahedral shape functions
989  case TET10:
990  {
991  libmesh_assert_less (i, 10);
992 
993  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
994  const Real zeta1 = p(0);
995  const Real zeta2 = p(1);
996  const Real zeta3 = p(2);
997  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
998 
999  const Real dzeta0dxi = -1.;
1000  const Real dzeta1dxi = 1.;
1001  const Real dzeta2dxi = 0.;
1002  const Real dzeta3dxi = 0.;
1003 
1004  const Real dzeta0deta = -1.;
1005  const Real dzeta1deta = 0.;
1006  const Real dzeta2deta = 1.;
1007  const Real dzeta3deta = 0.;
1008 
1009  const Real dzeta0dzeta = -1.;
1010  const Real dzeta1dzeta = 0.;
1011  const Real dzeta2dzeta = 0.;
1012  const Real dzeta3dzeta = 1.;
1013 
1014  switch (j)
1015  {
1016  // d()/dxi
1017  case 0:
1018  {
1019  switch(i)
1020  {
1021  case 0:
1022  return (4.*zeta0 - 1.)*dzeta0dxi;
1023 
1024  case 1:
1025  return (4.*zeta1 - 1.)*dzeta1dxi;
1026 
1027  case 2:
1028  return (4.*zeta2 - 1.)*dzeta2dxi;
1029 
1030  case 3:
1031  return (4.*zeta3 - 1.)*dzeta3dxi;
1032 
1033  case 4:
1034  return 4.*(zeta0*dzeta1dxi + dzeta0dxi*zeta1);
1035 
1036  case 5:
1037  return 4.*(zeta1*dzeta2dxi + dzeta1dxi*zeta2);
1038 
1039  case 6:
1040  return 4.*(zeta0*dzeta2dxi + dzeta0dxi*zeta2);
1041 
1042  case 7:
1043  return 4.*(zeta0*dzeta3dxi + dzeta0dxi*zeta3);
1044 
1045  case 8:
1046  return 4.*(zeta1*dzeta3dxi + dzeta1dxi*zeta3);
1047 
1048  case 9:
1049  return 4.*(zeta2*dzeta3dxi + dzeta2dxi*zeta3);
1050 
1051  default:
1052  libmesh_error_msg("Invalid i = " << i);
1053  }
1054  }
1055 
1056  // d()/deta
1057  case 1:
1058  {
1059  switch(i)
1060  {
1061  case 0:
1062  return (4.*zeta0 - 1.)*dzeta0deta;
1063 
1064  case 1:
1065  return (4.*zeta1 - 1.)*dzeta1deta;
1066 
1067  case 2:
1068  return (4.*zeta2 - 1.)*dzeta2deta;
1069 
1070  case 3:
1071  return (4.*zeta3 - 1.)*dzeta3deta;
1072 
1073  case 4:
1074  return 4.*(zeta0*dzeta1deta + dzeta0deta*zeta1);
1075 
1076  case 5:
1077  return 4.*(zeta1*dzeta2deta + dzeta1deta*zeta2);
1078 
1079  case 6:
1080  return 4.*(zeta0*dzeta2deta + dzeta0deta*zeta2);
1081 
1082  case 7:
1083  return 4.*(zeta0*dzeta3deta + dzeta0deta*zeta3);
1084 
1085  case 8:
1086  return 4.*(zeta1*dzeta3deta + dzeta1deta*zeta3);
1087 
1088  case 9:
1089  return 4.*(zeta2*dzeta3deta + dzeta2deta*zeta3);
1090 
1091  default:
1092  libmesh_error_msg("Invalid i = " << i);
1093  }
1094  }
1095 
1096  // d()/dzeta
1097  case 2:
1098  {
1099  switch(i)
1100  {
1101  case 0:
1102  return (4.*zeta0 - 1.)*dzeta0dzeta;
1103 
1104  case 1:
1105  return (4.*zeta1 - 1.)*dzeta1dzeta;
1106 
1107  case 2:
1108  return (4.*zeta2 - 1.)*dzeta2dzeta;
1109 
1110  case 3:
1111  return (4.*zeta3 - 1.)*dzeta3dzeta;
1112 
1113  case 4:
1114  return 4.*(zeta0*dzeta1dzeta + dzeta0dzeta*zeta1);
1115 
1116  case 5:
1117  return 4.*(zeta1*dzeta2dzeta + dzeta1dzeta*zeta2);
1118 
1119  case 6:
1120  return 4.*(zeta0*dzeta2dzeta + dzeta0dzeta*zeta2);
1121 
1122  case 7:
1123  return 4.*(zeta0*dzeta3dzeta + dzeta0dzeta*zeta3);
1124 
1125  case 8:
1126  return 4.*(zeta1*dzeta3dzeta + dzeta1dzeta*zeta3);
1127 
1128  case 9:
1129  return 4.*(zeta2*dzeta3dzeta + dzeta2dzeta*zeta3);
1130 
1131  default:
1132  libmesh_error_msg("Invalid i = " << i);
1133  }
1134  }
1135 
1136  default:
1137  libmesh_error_msg("Invalid j = " << j);
1138  }
1139  }
1140 
1141 
1142 
1143  // quadradic prism shape functions
1144  case PRISM18:
1145  {
1146  libmesh_assert_less (i, 18);
1147 
1148  // Compute prism shape functions as a tensor-product
1149  // of a triangle and an edge
1150 
1151  Point p2d(p(0),p(1));
1152  Point p1d(p(2));
1153 
1154  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
1155  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2};
1156  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 3, 4, 5};
1157 
1158  switch (j)
1159  {
1160  // d()/dxi
1161  case 0:
1162  return (FE<2,L2_LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 0, p2d)*
1163  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
1164 
1165  // d()/deta
1166  case 1:
1167  return (FE<2,L2_LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 1, p2d)*
1168  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
1169 
1170  // d()/dzeta
1171  case 2:
1172  return (FE<2,L2_LAGRANGE>::shape(TRI6, SECOND, i1[i], p2d)*
1173  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, p1d));
1174 
1175  default:
1176  libmesh_error_msg("Invalid shape function derivative j = " << j);
1177  }
1178  }
1179 
1180 
1181  default:
1182  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
1183  }
1184  }
1185 
1186 
1187  // unsupported order
1188  default:
1189  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << order);
1190  }
1191 
1192 #endif
1193 
1194  libmesh_error_msg("We'll never get here!");
1195  return 0.;
1196 }
PetscErrorCode Vec x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, BERNSTEIN >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 387 of file fe_bernstein_shape_2D.C.

392 {
393  libmesh_error_msg("Bernstein polynomials require the element type \nbecause edge orientation is needed.");
394  return 0.;
395 }
template<>
Real libMesh::FE< 2, BERNSTEIN >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 400 of file fe_bernstein_shape_2D.C.

References libMesh::EDGE3, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::Real, libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::square_number_column, libMesh::square_number_row, libMesh::TRI3, libMesh::TRI6, libMesh::TRISHELL3, and libMesh::Elem::type().

405 {
406  libmesh_assert(elem);
407 
408  const ElemType type = elem->type();
409 
410  const Order totalorder = static_cast<Order>(order + elem->p_level());
411 
412  switch (type)
413  {
414  // Hierarchic shape functions on the quadrilateral.
415  case QUAD4:
416  case QUAD9:
417  {
418  // Compute quad shape functions as a tensor-product
419  const Real xi = p(0);
420  const Real eta = p(1);
421 
422  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
423 
424  unsigned int i0, i1;
425 
426  // Vertex DoFs
427  if (i == 0)
428  { i0 = 0; i1 = 0; }
429  else if (i == 1)
430  { i0 = 1; i1 = 0; }
431  else if (i == 2)
432  { i0 = 1; i1 = 1; }
433  else if (i == 3)
434  { i0 = 0; i1 = 1; }
435 
436 
437  // Edge DoFs
438  else if (i < totalorder + 3u)
439  { i0 = i - 2; i1 = 0; }
440  else if (i < 2u*totalorder + 2)
441  { i0 = 1; i1 = i - totalorder - 1; }
442  else if (i < 3u*totalorder + 1)
443  { i0 = i - 2u*totalorder; i1 = 1; }
444  else if (i < 4u*totalorder)
445  { i0 = 0; i1 = i - 3u*totalorder + 1; }
446  // Interior DoFs
447  else
448  {
449  unsigned int basisnum = i - 4*totalorder;
450  i0 = square_number_column[basisnum] + 2;
451  i1 = square_number_row[basisnum] + 2;
452  }
453 
454 
455  // Flip odd degree of freedom values if necessary
456  // to keep continuity on sides
457  if ((i>= 4 && i<= 4+ totalorder-2u) && elem->point(0) > elem->point(1)) i0=totalorder+2-i0;//
458  else if((i>= 4+ totalorder-1u && i<= 4+2*totalorder-3u) && elem->point(1) > elem->point(2)) i1=totalorder+2-i1;
459  else if((i>= 4+2*totalorder-2u && i<= 4+3*totalorder-4u) && elem->point(3) > elem->point(2)) i0=totalorder+2-i0;
460  else if((i>= 4+3*totalorder-3u && i<= 4+4*totalorder-5u) && elem->point(0) > elem->point(3)) i1=totalorder+2-i1;
461 
462  switch (j)
463  {
464  // d()/dxi
465  case 0:
466  return (FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0, 0, xi)*
467  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1, eta));
468 
469  // d()/deta
470  case 1:
471  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0, xi)*
472  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1, 0, eta));
473 
474  default:
475  libmesh_error_msg("Invalid shape function derivative j = " << j);
476  }
477  }
478 
479  // Bernstein shape functions on the 8-noded quadrilateral
480  // is handled separately.
481  case QUAD8:
482  {
483  libmesh_assert_less (totalorder, 3);
484 
485  const Real xi = p(0);
486  const Real eta = p(1);
487 
488  libmesh_assert_less (i, 8);
489 
490  // 0 1 2 3 4 5 6 7 8
491  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
492  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
493  static const Real scal[] = {-0.25, -0.25, -0.25, -0.25, 0.5, 0.5, 0.5, 0.5};
494  switch (j)
495  {
496  // d()/dxi
497  case 0:
498  return (FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
499  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta)
500  +scal[i]*
501  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[8], 0, xi)*
502  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[8], eta));
503 
504  // d()/deta
505  case 1:
506  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi)*
507  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta)
508  +scal[i]*
509  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[8], xi)*
510  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[8], 0, eta));
511 
512  default:
513  libmesh_error_msg("Invalid shape function derivative j = " << j);
514  }
515  }
516 
517  case TRI3:
518  case TRISHELL3:
519  libmesh_assert_less (totalorder, 2);
520  case TRI6:
521  {
522  // I have been lazy here and am using finite differences
523  // to compute the derivatives!
524  const Real eps = 1.e-6;
525 
526  switch (j)
527  {
528  // d()/dxi
529  case 0:
530  {
531  const Point pp(p(0)+eps, p(1));
532  const Point pm(p(0)-eps, p(1));
533 
534  return (FE<2,BERNSTEIN>::shape(elem, totalorder, i, pp) -
535  FE<2,BERNSTEIN>::shape(elem, totalorder, i, pm))/2./eps;
536  }
537 
538  // d()/deta
539  case 1:
540  {
541  const Point pp(p(0), p(1)+eps);
542  const Point pm(p(0), p(1)-eps);
543 
544  return (FE<2,BERNSTEIN>::shape(elem, totalorder, i, pp) -
545  FE<2,BERNSTEIN>::shape(elem, totalorder, i, pm))/2./eps;
546  }
547 
548 
549  default:
550  libmesh_error_msg("Invalid shape function derivative j = " << j);
551  }
552  }
553 
554  default:
555  libmesh_error_msg("ERROR: Unsupported element type = " << type);
556  }
557 
558  libmesh_error_msg("We'll never get here!");
559  return 0.;
560 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
const unsigned char square_number_column[]
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned char square_number_row[]
template<>
Real libMesh::FE< 3, HERMITE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 450 of file fe_hermite_shape_3D.C.

455 {
456  libmesh_error_msg("Hermite elements require the real element \nto construct gradient-based degrees of freedom.");
457  return 0.;
458 }
template<>
Real libMesh::FE< 3, HERMITE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 463 of file fe_hermite_shape_3D.C.

References libMesh::FEHermite< Dim >::hermite_raw_shape(), libMesh::FEHermite< Dim >::hermite_raw_shape_deriv(), libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Real, libMesh::THIRD, and libMesh::Elem::type().

468 {
469  libmesh_assert(elem);
470  libmesh_assert (j == 0 || j == 1 || j == 2);
471 
472  std::vector<std::vector<Real> > dxdxi(3, std::vector<Real>(2, 0));
473 
474 #ifdef DEBUG
475  std::vector<Real> dydxi(2), dzdeta(2), dxdzeta(2);
476  std::vector<Real> dzdxi(2), dxdeta(2), dydzeta(2);
477 #endif //DEBUG
478 
479  hermite_compute_coefs(elem, dxdxi
480 #ifdef DEBUG
481  , dydxi, dzdeta, dxdzeta, dzdxi, dxdeta, dydzeta
482 #endif
483  );
484 
485  const ElemType type = elem->type();
486 
487  const Order totalorder = static_cast<Order>(order + elem->p_level());
488 
489  switch (totalorder)
490  {
491  // 3rd-order tricubic Hermite functions
492  case THIRD:
493  {
494  switch (type)
495  {
496  case HEX8:
497  case HEX20:
498  case HEX27:
499  {
500  libmesh_assert_less (i, 64);
501 
502  std::vector<unsigned int> bases1D;
503 
504  Real coef = hermite_bases_3D(bases1D, dxdxi, totalorder, i);
505 
506  switch (j) // Derivative type
507  {
508  case 0:
509  return coef *
510  FEHermite<1>::hermite_raw_shape_deriv(bases1D[0],p(0)) *
511  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1)) *
512  FEHermite<1>::hermite_raw_shape(bases1D[2],p(2));
513  break;
514  case 1:
515  return coef *
516  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
517  FEHermite<1>::hermite_raw_shape_deriv(bases1D[1],p(1)) *
518  FEHermite<1>::hermite_raw_shape(bases1D[2],p(2));
519  break;
520  case 2:
521  return coef *
522  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
523  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1)) *
524  FEHermite<1>::hermite_raw_shape_deriv(bases1D[2],p(2));
525  break;
526  default:
527  libmesh_error_msg("Invalid shape function derivative j = " << j);
528  }
529 
530  }
531  default:
532  libmesh_error_msg("ERROR: Unsupported element type " << type);
533  }
534  }
535  // by default throw an error
536  default:
537  libmesh_error_msg("ERROR: Unsupported polynomial order " << totalorder);
538  }
539 
540  libmesh_error_msg("We'll never get here!");
541  return 0.;
542 }
libmesh_assert(remote_elem)
unsigned int p_level() const
Definition: elem.h:2141
static Real hermite_raw_shape(const unsigned int basis_num, const Real xi)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static Real hermite_raw_shape_deriv(const unsigned int basis_num, const Real xi)
virtual ElemType type() const =0
template<>
RealGradient libMesh::FE< 0, LAGRANGE_VEC >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 544 of file fe_lagrange_vec.C.

References libMesh::Real, and libMesh::FE< Dim, T >::shape_deriv().

547 {
548  Real value = FE<0,LAGRANGE>::shape_deriv( type, order, i, j, p );
549  return libMesh::RealGradient( value );
550 }
RealVectorValue RealGradient
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, LAGRANGE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 551 of file fe_lagrange_shape_2D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

556 {
557  libmesh_assert(elem);
558 
559 
560  // call the orientation-independent shape functions
561  return FE<2,LAGRANGE>::shape_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
562 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 2, SUBDIVISION >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
template<>
Real libMesh::FE< 2, L2_LAGRANGE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 555 of file fe_l2_lagrange_shape_2D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

560 {
561  libmesh_assert(elem);
562 
563 
564  // call the orientation-independent shape functions
565  return FE<2,L2_LAGRANGE>::shape_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
566 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
RealGradient libMesh::FE< 1, LAGRANGE_VEC >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 566 of file fe_lagrange_vec.C.

References libMesh::Real, and libMesh::FE< Dim, T >::shape_deriv().

569 {
570  Real value = FE<1,LAGRANGE>::shape_deriv( type, order, i, j, p );
571  return libMesh::RealGradient( value );
572 }
RealVectorValue RealGradient
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, LAGRANGE >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 574 of file fe_lagrange_shape_3D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::FIRST, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::Real, libMesh::SECOND, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, and libMesh::x.

579 {
580 #if LIBMESH_DIM == 3
581 
582  libmesh_assert_less (j, 3);
583 
584  switch (order)
585  {
586  // linear Lagrange shape functions
587  case FIRST:
588  {
589  switch (type)
590  {
591  // trilinear hexahedral shape functions
592  case HEX8:
593  case HEX20:
594  case HEX27:
595  {
596  libmesh_assert_less (i, 8);
597 
598  // Compute hex shape functions as a tensor-product
599  const Real xi = p(0);
600  const Real eta = p(1);
601  const Real zeta = p(2);
602 
603  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
604  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
605  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
606 
607  switch(j)
608  {
609  case 0:
610  return (FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
611  FE<1,LAGRANGE>::shape (EDGE2, FIRST, i1[i], eta)*
612  FE<1,LAGRANGE>::shape (EDGE2, FIRST, i2[i], zeta));
613 
614  case 1:
615  return (FE<1,LAGRANGE>::shape (EDGE2, FIRST, i0[i], xi)*
616  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta)*
617  FE<1,LAGRANGE>::shape (EDGE2, FIRST, i2[i], zeta));
618 
619  case 2:
620  return (FE<1,LAGRANGE>::shape (EDGE2, FIRST, i0[i], xi)*
621  FE<1,LAGRANGE>::shape (EDGE2, FIRST, i1[i], eta)*
622  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i2[i], 0, zeta));
623 
624  default:
625  libmesh_error_msg("Invalid j = " << j);
626  }
627  }
628 
629  // linear tetrahedral shape functions
630  case TET4:
631  case TET10:
632  {
633  libmesh_assert_less (i, 4);
634 
635  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
636  const Real dzeta0dxi = -1.;
637  const Real dzeta1dxi = 1.;
638  const Real dzeta2dxi = 0.;
639  const Real dzeta3dxi = 0.;
640 
641  const Real dzeta0deta = -1.;
642  const Real dzeta1deta = 0.;
643  const Real dzeta2deta = 1.;
644  const Real dzeta3deta = 0.;
645 
646  const Real dzeta0dzeta = -1.;
647  const Real dzeta1dzeta = 0.;
648  const Real dzeta2dzeta = 0.;
649  const Real dzeta3dzeta = 1.;
650 
651  switch (j)
652  {
653  // d()/dxi
654  case 0:
655  {
656  switch(i)
657  {
658  case 0:
659  return dzeta0dxi;
660 
661  case 1:
662  return dzeta1dxi;
663 
664  case 2:
665  return dzeta2dxi;
666 
667  case 3:
668  return dzeta3dxi;
669 
670  default:
671  libmesh_error_msg("Invalid i = " << i);
672  }
673  }
674 
675  // d()/deta
676  case 1:
677  {
678  switch(i)
679  {
680  case 0:
681  return dzeta0deta;
682 
683  case 1:
684  return dzeta1deta;
685 
686  case 2:
687  return dzeta2deta;
688 
689  case 3:
690  return dzeta3deta;
691 
692  default:
693  libmesh_error_msg("Invalid i = " << i);
694  }
695  }
696 
697  // d()/dzeta
698  case 2:
699  {
700  switch(i)
701  {
702  case 0:
703  return dzeta0dzeta;
704 
705  case 1:
706  return dzeta1dzeta;
707 
708  case 2:
709  return dzeta2dzeta;
710 
711  case 3:
712  return dzeta3dzeta;
713 
714  default:
715  libmesh_error_msg("Invalid i = " << i);
716  }
717  }
718 
719  default:
720  libmesh_error_msg("Invalid shape function derivative j = " << j);
721  }
722  }
723 
724  // linear prism shape functions
725  case PRISM6:
726  case PRISM15:
727  case PRISM18:
728  {
729  libmesh_assert_less (i, 6);
730 
731  // Compute prism shape functions as a tensor-product
732  // of a triangle and an edge
733 
734  Point p2d(p(0),p(1));
735  Point p1d(p(2));
736 
737  // 0 1 2 3 4 5
738  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1};
739  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2};
740 
741  switch (j)
742  {
743  // d()/dxi
744  case 0:
745  return (FE<2,LAGRANGE>::shape_deriv(TRI3, FIRST, i1[i], 0, p2d)*
746  FE<1,LAGRANGE>::shape(EDGE2, FIRST, i0[i], p1d));
747 
748  // d()/deta
749  case 1:
750  return (FE<2,LAGRANGE>::shape_deriv(TRI3, FIRST, i1[i], 1, p2d)*
751  FE<1,LAGRANGE>::shape(EDGE2, FIRST, i0[i], p1d));
752 
753  // d()/dzeta
754  case 2:
755  return (FE<2,LAGRANGE>::shape(TRI3, FIRST, i1[i], p2d)*
756  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, p1d));
757 
758  default:
759  libmesh_error_msg("Invalid shape function derivative j = " << j);
760  }
761  }
762 
763  // linear pyramid shape functions
764  case PYRAMID5:
765  case PYRAMID13:
766  case PYRAMID14:
767  {
768  libmesh_assert_less (i, 5);
769 
770  const Real xi = p(0);
771  const Real eta = p(1);
772  const Real zeta = p(2);
773  const Real eps = 1.e-35;
774 
775  switch (j)
776  {
777  // d/dxi
778  case 0:
779  switch(i)
780  {
781  case 0:
782  return .25*(zeta + eta - 1.)/((1. - zeta) + eps);
783 
784  case 1:
785  return -.25*(zeta + eta - 1.)/((1. - zeta) + eps);
786 
787  case 2:
788  return -.25*(zeta - eta - 1.)/((1. - zeta) + eps);
789 
790  case 3:
791  return .25*(zeta - eta - 1.)/((1. - zeta) + eps);
792 
793  case 4:
794  return 0;
795 
796  default:
797  libmesh_error_msg("Invalid i = " << i);
798  }
799 
800 
801  // d/deta
802  case 1:
803  switch(i)
804  {
805  case 0:
806  return .25*(zeta + xi - 1.)/((1. - zeta) + eps);
807 
808  case 1:
809  return .25*(zeta - xi - 1.)/((1. - zeta) + eps);
810 
811  case 2:
812  return -.25*(zeta - xi - 1.)/((1. - zeta) + eps);
813 
814  case 3:
815  return -.25*(zeta + xi - 1.)/((1. - zeta) + eps);
816 
817  case 4:
818  return 0;
819 
820  default:
821  libmesh_error_msg("Invalid i = " << i);
822  }
823 
824 
825  // d/dzeta
826  case 2:
827  {
828  // We computed the derivatives with general eps and
829  // then let eps tend to zero in the numerators...
830  Real
831  num = zeta*(2. - zeta) - 1.,
832  den = (1. - zeta + eps)*(1. - zeta + eps);
833 
834  switch(i)
835  {
836  case 0:
837  case 2:
838  return .25*(num + xi*eta)/den;
839 
840  case 1:
841  case 3:
842  return .25*(num - xi*eta)/den;
843 
844  case 4:
845  return 1.;
846 
847  default:
848  libmesh_error_msg("Invalid i = " << i);
849  }
850  }
851 
852  default:
853  libmesh_error_msg("Invalid j = " << j);
854  }
855  }
856 
857 
858  default:
859  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
860  }
861  }
862 
863 
864  // quadratic Lagrange shape functions
865  case SECOND:
866  {
867  switch (type)
868  {
869 
870  // serendipity hexahedral quadratic shape functions
871  case HEX20:
872  {
873  libmesh_assert_less (i, 20);
874 
875  const Real xi = p(0);
876  const Real eta = p(1);
877  const Real zeta = p(2);
878 
879  // these functions are defined for (x,y,z) in [0,1]^3
880  // so transform the locations
881  const Real x = .5*(xi + 1.);
882  const Real y = .5*(eta + 1.);
883  const Real z = .5*(zeta + 1.);
884 
885  // and don't forget the chain rule!
886 
887  switch (j)
888  {
889 
890  // d/dx*dx/dxi
891  case 0:
892  switch (i)
893  {
894  case 0:
895  return .5*(1. - y)*(1. - z)*((1. - x)*(-2.) +
896  (-1.)*(1. - 2.*x - 2.*y - 2.*z));
897 
898  case 1:
899  return .5*(1. - y)*(1. - z)*(x*(2.) +
900  (1.)*(2.*x - 2.*y - 2.*z - 1.));
901 
902  case 2:
903  return .5*y*(1. - z)*(x*(2.) +
904  (1.)*(2.*x + 2.*y - 2.*z - 3.));
905 
906  case 3:
907  return .5*y*(1. - z)*((1. - x)*(-2.) +
908  (-1.)*(2.*y - 2.*x - 2.*z - 1.));
909 
910  case 4:
911  return .5*(1. - y)*z*((1. - x)*(-2.) +
912  (-1.)*(2.*z - 2.*x - 2.*y - 1.));
913 
914  case 5:
915  return .5*(1. - y)*z*(x*(2.) +
916  (1.)*(2.*x - 2.*y + 2.*z - 3.));
917 
918  case 6:
919  return .5*y*z*(x*(2.) +
920  (1.)*(2.*x + 2.*y + 2.*z - 5.));
921 
922  case 7:
923  return .5*y*z*((1. - x)*(-2.) +
924  (-1.)*(2.*y - 2.*x + 2.*z - 3.));
925 
926  case 8:
927  return 2.*(1. - y)*(1. - z)*(1. - 2.*x);
928 
929  case 9:
930  return 2.*y*(1. - y)*(1. - z);
931 
932  case 10:
933  return 2.*y*(1. - z)*(1. - 2.*x);
934 
935  case 11:
936  return 2.*y*(1. - y)*(1. - z)*(-1.);
937 
938  case 12:
939  return 2.*(1. - y)*z*(1. - z)*(-1.);
940 
941  case 13:
942  return 2.*(1. - y)*z*(1. - z);
943 
944  case 14:
945  return 2.*y*z*(1. - z);
946 
947  case 15:
948  return 2.*y*z*(1. - z)*(-1.);
949 
950  case 16:
951  return 2.*(1. - y)*z*(1. - 2.*x);
952 
953  case 17:
954  return 2.*y*(1. - y)*z;
955 
956  case 18:
957  return 2.*y*z*(1. - 2.*x);
958 
959  case 19:
960  return 2.*y*(1. - y)*z*(-1.);
961 
962  default:
963  libmesh_error_msg("Invalid i = " << i);
964  }
965 
966 
967  // d/dy*dy/deta
968  case 1:
969  switch (i)
970  {
971  case 0:
972  return .5*(1. - x)*(1. - z)*((1. - y)*(-2.) +
973  (-1.)*(1. - 2.*x - 2.*y - 2.*z));
974 
975  case 1:
976  return .5*x*(1. - z)*((1. - y)*(-2.) +
977  (-1.)*(2.*x - 2.*y - 2.*z - 1.));
978 
979  case 2:
980  return .5*x*(1. - z)*(y*(2.) +
981  (1.)*(2.*x + 2.*y - 2.*z - 3.));
982 
983  case 3:
984  return .5*(1. - x)*(1. - z)*(y*(2.) +
985  (1.)*(2.*y - 2.*x - 2.*z - 1.));
986 
987  case 4:
988  return .5*(1. - x)*z*((1. - y)*(-2.) +
989  (-1.)*(2.*z - 2.*x - 2.*y - 1.));
990 
991  case 5:
992  return .5*x*z*((1. - y)*(-2.) +
993  (-1.)*(2.*x - 2.*y + 2.*z - 3.));
994 
995  case 6:
996  return .5*x*z*(y*(2.) +
997  (1.)*(2.*x + 2.*y + 2.*z - 5.));
998 
999  case 7:
1000  return .5*(1. - x)*z*(y*(2.) +
1001  (1.)*(2.*y - 2.*x + 2.*z - 3.));
1002 
1003  case 8:
1004  return 2.*x*(1. - x)*(1. - z)*(-1.);
1005 
1006  case 9:
1007  return 2.*x*(1. - z)*(1. - 2.*y);
1008 
1009  case 10:
1010  return 2.*x*(1. - x)*(1. - z);
1011 
1012  case 11:
1013  return 2.*(1. - x)*(1. - z)*(1. - 2.*y);
1014 
1015  case 12:
1016  return 2.*(1. - x)*z*(1. - z)*(-1.);
1017 
1018  case 13:
1019  return 2.*x*z*(1. - z)*(-1.);
1020 
1021  case 14:
1022  return 2.*x*z*(1. - z);
1023 
1024  case 15:
1025  return 2.*(1. - x)*z*(1. - z);
1026 
1027  case 16:
1028  return 2.*x*(1. - x)*z*(-1.);
1029 
1030  case 17:
1031  return 2.*x*z*(1. - 2.*y);
1032 
1033  case 18:
1034  return 2.*x*(1. - x)*z;
1035 
1036  case 19:
1037  return 2.*(1. - x)*z*(1. - 2.*y);
1038 
1039  default:
1040  libmesh_error_msg("Invalid i = " << i);
1041  }
1042 
1043 
1044  // d/dz*dz/dzeta
1045  case 2:
1046  switch (i)
1047  {
1048  case 0:
1049  return .5*(1. - x)*(1. - y)*((1. - z)*(-2.) +
1050  (-1.)*(1. - 2.*x - 2.*y - 2.*z));
1051 
1052  case 1:
1053  return .5*x*(1. - y)*((1. - z)*(-2.) +
1054  (-1.)*(2.*x - 2.*y - 2.*z - 1.));
1055 
1056  case 2:
1057  return .5*x*y*((1. - z)*(-2.) +
1058  (-1.)*(2.*x + 2.*y - 2.*z - 3.));
1059 
1060  case 3:
1061  return .5*(1. - x)*y*((1. - z)*(-2.) +
1062  (-1.)*(2.*y - 2.*x - 2.*z - 1.));
1063 
1064  case 4:
1065  return .5*(1. - x)*(1. - y)*(z*(2.) +
1066  (1.)*(2.*z - 2.*x - 2.*y - 1.));
1067 
1068  case 5:
1069  return .5*x*(1. - y)*(z*(2.) +
1070  (1.)*(2.*x - 2.*y + 2.*z - 3.));
1071 
1072  case 6:
1073  return .5*x*y*(z*(2.) +
1074  (1.)*(2.*x + 2.*y + 2.*z - 5.));
1075 
1076  case 7:
1077  return .5*(1. - x)*y*(z*(2.) +
1078  (1.)*(2.*y - 2.*x + 2.*z - 3.));
1079 
1080  case 8:
1081  return 2.*x*(1. - x)*(1. - y)*(-1.);
1082 
1083  case 9:
1084  return 2.*x*y*(1. - y)*(-1.);
1085 
1086  case 10:
1087  return 2.*x*(1. - x)*y*(-1.);
1088 
1089  case 11:
1090  return 2.*(1. - x)*y*(1. - y)*(-1.);
1091 
1092  case 12:
1093  return 2.*(1. - x)*(1. - y)*(1. - 2.*z);
1094 
1095  case 13:
1096  return 2.*x*(1. - y)*(1. - 2.*z);
1097 
1098  case 14:
1099  return 2.*x*y*(1. - 2.*z);
1100 
1101  case 15:
1102  return 2.*(1. - x)*y*(1. - 2.*z);
1103 
1104  case 16:
1105  return 2.*x*(1. - x)*(1. - y);
1106 
1107  case 17:
1108  return 2.*x*y*(1. - y);
1109 
1110  case 18:
1111  return 2.*x*(1. - x)*y;
1112 
1113  case 19:
1114  return 2.*(1. - x)*y*(1. - y);
1115 
1116  default:
1117  libmesh_error_msg("Invalid i = " << i);
1118  }
1119 
1120  default:
1121  libmesh_error_msg("Invalid shape function derivative j = " << j);
1122  }
1123  }
1124 
1125  // triquadraic hexahedral shape funcions
1126  case HEX27:
1127  {
1128  libmesh_assert_less (i, 27);
1129 
1130  // Compute hex shape functions as a tensor-product
1131  const Real xi = p(0);
1132  const Real eta = p(1);
1133  const Real zeta = p(2);
1134 
1135  // The only way to make any sense of this
1136  // is to look at the mgflo/mg2/mgf documentation
1137  // and make the cut-out cube!
1138  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
1139  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
1140  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
1141  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
1142 
1143  switch(j)
1144  {
1145  case 0:
1146  return (FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
1147  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
1148  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
1149 
1150  case 1:
1151  return (FE<1,LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
1152  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta)*
1153  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
1154 
1155  case 2:
1156  return (FE<1,LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
1157  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
1158  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i2[i], 0, zeta));
1159 
1160  default:
1161  libmesh_error_msg("Invalid j = " << j);
1162  }
1163  }
1164 
1165  // quadratic tetrahedral shape functions
1166  case TET10:
1167  {
1168  libmesh_assert_less (i, 10);
1169 
1170  // Area coordinates, pg. 205, Vol. I, Carey, Oden, Becker FEM
1171  const Real zeta1 = p(0);
1172  const Real zeta2 = p(1);
1173  const Real zeta3 = p(2);
1174  const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
1175 
1176  const Real dzeta0dxi = -1.;
1177  const Real dzeta1dxi = 1.;
1178  const Real dzeta2dxi = 0.;
1179  const Real dzeta3dxi = 0.;
1180 
1181  const Real dzeta0deta = -1.;
1182  const Real dzeta1deta = 0.;
1183  const Real dzeta2deta = 1.;
1184  const Real dzeta3deta = 0.;
1185 
1186  const Real dzeta0dzeta = -1.;
1187  const Real dzeta1dzeta = 0.;
1188  const Real dzeta2dzeta = 0.;
1189  const Real dzeta3dzeta = 1.;
1190 
1191  switch (j)
1192  {
1193  // d()/dxi
1194  case 0:
1195  {
1196  switch(i)
1197  {
1198  case 0:
1199  return (4.*zeta0 - 1.)*dzeta0dxi;
1200 
1201  case 1:
1202  return (4.*zeta1 - 1.)*dzeta1dxi;
1203 
1204  case 2:
1205  return (4.*zeta2 - 1.)*dzeta2dxi;
1206 
1207  case 3:
1208  return (4.*zeta3 - 1.)*dzeta3dxi;
1209 
1210  case 4:
1211  return 4.*(zeta0*dzeta1dxi + dzeta0dxi*zeta1);
1212 
1213  case 5:
1214  return 4.*(zeta1*dzeta2dxi + dzeta1dxi*zeta2);
1215 
1216  case 6:
1217  return 4.*(zeta0*dzeta2dxi + dzeta0dxi*zeta2);
1218 
1219  case 7:
1220  return 4.*(zeta0*dzeta3dxi + dzeta0dxi*zeta3);
1221 
1222  case 8:
1223  return 4.*(zeta1*dzeta3dxi + dzeta1dxi*zeta3);
1224 
1225  case 9:
1226  return 4.*(zeta2*dzeta3dxi + dzeta2dxi*zeta3);
1227 
1228  default:
1229  libmesh_error_msg("Invalid i = " << i);
1230  }
1231  }
1232 
1233  // d()/deta
1234  case 1:
1235  {
1236  switch(i)
1237  {
1238  case 0:
1239  return (4.*zeta0 - 1.)*dzeta0deta;
1240 
1241  case 1:
1242  return (4.*zeta1 - 1.)*dzeta1deta;
1243 
1244  case 2:
1245  return (4.*zeta2 - 1.)*dzeta2deta;
1246 
1247  case 3:
1248  return (4.*zeta3 - 1.)*dzeta3deta;
1249 
1250  case 4:
1251  return 4.*(zeta0*dzeta1deta + dzeta0deta*zeta1);
1252 
1253  case 5:
1254  return 4.*(zeta1*dzeta2deta + dzeta1deta*zeta2);
1255 
1256  case 6:
1257  return 4.*(zeta0*dzeta2deta + dzeta0deta*zeta2);
1258 
1259  case 7:
1260  return 4.*(zeta0*dzeta3deta + dzeta0deta*zeta3);
1261 
1262  case 8:
1263  return 4.*(zeta1*dzeta3deta + dzeta1deta*zeta3);
1264 
1265  case 9:
1266  return 4.*(zeta2*dzeta3deta + dzeta2deta*zeta3);
1267 
1268  default:
1269  libmesh_error_msg("Invalid i = " << i);
1270  }
1271  }
1272 
1273  // d()/dzeta
1274  case 2:
1275  {
1276  switch(i)
1277  {
1278  case 0:
1279  return (4.*zeta0 - 1.)*dzeta0dzeta;
1280 
1281  case 1:
1282  return (4.*zeta1 - 1.)*dzeta1dzeta;
1283 
1284  case 2:
1285  return (4.*zeta2 - 1.)*dzeta2dzeta;
1286 
1287  case 3:
1288  return (4.*zeta3 - 1.)*dzeta3dzeta;
1289 
1290  case 4:
1291  return 4.*(zeta0*dzeta1dzeta + dzeta0dzeta*zeta1);
1292 
1293  case 5:
1294  return 4.*(zeta1*dzeta2dzeta + dzeta1dzeta*zeta2);
1295 
1296  case 6:
1297  return 4.*(zeta0*dzeta2dzeta + dzeta0dzeta*zeta2);
1298 
1299  case 7:
1300  return 4.*(zeta0*dzeta3dzeta + dzeta0dzeta*zeta3);
1301 
1302  case 8:
1303  return 4.*(zeta1*dzeta3dzeta + dzeta1dzeta*zeta3);
1304 
1305  case 9:
1306  return 4.*(zeta2*dzeta3dzeta + dzeta2dzeta*zeta3);
1307 
1308  default:
1309  libmesh_error_msg("Invalid i = " << i);
1310  }
1311  }
1312 
1313  default:
1314  libmesh_error_msg("Invalid j = " << j);
1315  }
1316  }
1317 
1318 
1319  // "serendipity" prism
1320  case PRISM15:
1321  {
1322  libmesh_assert_less (i, 15);
1323 
1324  const Real xi = p(0);
1325  const Real eta = p(1);
1326  const Real zeta = p(2);
1327 
1328  switch (j)
1329  {
1330  // d()/dxi
1331  case 0:
1332  {
1333  switch(i)
1334  {
1335  case 0:
1336  return (2.*xi + 2.*eta + 0.5*zeta - 1.)*(1. - zeta);
1337  case 1:
1338  return (2.*xi - 1. - 0.5*zeta)*(1. - zeta);
1339  case 2:
1340  return 0.;
1341  case 3:
1342  return (2.*xi + 2.*eta - 0.5*zeta - 1.)*(1. + zeta);
1343  case 4:
1344  return (2.*xi - 1. + 0.5*zeta)*(1. + zeta);
1345  case 5:
1346  return 0.;
1347  case 6:
1348  return (4.*xi + 2.*eta - 2.)*(zeta - 1.);
1349  case 7:
1350  return -2.*(zeta - 1.)*eta;
1351  case 8:
1352  return 2.*(zeta - 1.)*eta;
1353  case 9:
1354  return (zeta - 1.)*(1. + zeta);
1355  case 10:
1356  return (1. - zeta)*(1. + zeta);
1357  case 11:
1358  return 0.;
1359  case 12:
1360  return (-4.*xi - 2.*eta + 2.)*(1. + zeta);
1361  case 13:
1362  return 2.*(1. + zeta)*eta;
1363  case 14:
1364  return -2.*(1. + zeta)*eta;
1365  default:
1366  libmesh_error_msg("Invalid i = " << i);
1367  }
1368  }
1369 
1370  // d()/deta
1371  case 1:
1372  {
1373  switch(i)
1374  {
1375  case 0:
1376  return (2.*xi + 2.*eta + 0.5*zeta - 1.)*(1. - zeta);
1377  case 1:
1378  return 0.;
1379  case 2:
1380  return (2.*eta - 1. - 0.5*zeta)*(1. - zeta);
1381  case 3:
1382  return (2.*xi + 2.*eta - 0.5*zeta - 1.)*(1. + zeta);
1383  case 4:
1384  return 0.;
1385  case 5:
1386  return (2.*eta - 1. + 0.5*zeta)*(1. + zeta);
1387  case 6:
1388  return 2.*(zeta - 1.)*xi;
1389  case 7:
1390  return 2.*(1. - zeta)*xi;
1391  case 8:
1392  return (2.*xi + 4.*eta - 2.)*(zeta - 1.);
1393  case 9:
1394  return (zeta - 1.)*(1. + zeta);
1395  case 10:
1396  return 0.;
1397  case 11:
1398  return (1. - zeta)*(1. + zeta);
1399  case 12:
1400  return -2.*(1. + zeta)*xi;
1401  case 13:
1402  return 2.*(1. + zeta)*xi;
1403  case 14:
1404  return (-2.*xi - 4.*eta + 2.)*(1. + zeta);
1405 
1406  default:
1407  libmesh_error_msg("Invalid i = " << i);
1408  }
1409  }
1410 
1411  // d()/dzeta
1412  case 2:
1413  {
1414  switch(i)
1415  {
1416  case 0:
1417  return (-xi - eta - zeta + 0.5)*(xi + eta - 1.);
1418  case 1:
1419  return -0.5*xi*(2.*xi - 1. - 2.*zeta);
1420  case 2:
1421  return -0.5*eta*(2.*eta - 1. - 2.*zeta);
1422  case 3:
1423  return (xi + eta - zeta - 0.5)*(xi + eta - 1.);
1424  case 4:
1425  return 0.5*xi*(2.*xi - 1. + 2.*zeta);
1426  case 5:
1427  return 0.5*eta*(2.*eta - 1. + 2.*zeta);
1428  case 6:
1429  return 2.*xi*(xi + eta - 1.);
1430  case 7:
1431  return -2.*xi*eta;
1432  case 8:
1433  return 2.*eta*(xi + eta - 1.);
1434  case 9:
1435  return 2.*zeta*(xi + eta - 1.);
1436  case 10:
1437  return -2.*xi*zeta;
1438  case 11:
1439  return -2.*eta*zeta;
1440  case 12:
1441  return 2.*xi*(1. - xi - eta);
1442  case 13:
1443  return 2.*xi*eta;
1444  case 14:
1445  return 2.*eta*(1. - xi - eta);
1446 
1447  default:
1448  libmesh_error_msg("Invalid i = " << i);
1449  }
1450  }
1451 
1452  default:
1453  libmesh_error_msg("Invalid j = " << j);
1454  }
1455  }
1456 
1457 
1458 
1459  // quadradic prism shape functions
1460  case PRISM18:
1461  {
1462  libmesh_assert_less (i, 18);
1463 
1464  // Compute prism shape functions as a tensor-product
1465  // of a triangle and an edge
1466 
1467  Point p2d(p(0),p(1));
1468  Point p1d(p(2));
1469 
1470  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
1471  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2};
1472  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 3, 4, 5};
1473 
1474  switch (j)
1475  {
1476  // d()/dxi
1477  case 0:
1478  return (FE<2,LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 0, p2d)*
1479  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
1480 
1481  // d()/deta
1482  case 1:
1483  return (FE<2,LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 1, p2d)*
1484  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
1485 
1486  // d()/dzeta
1487  case 2:
1488  return (FE<2,LAGRANGE>::shape(TRI6, SECOND, i1[i], p2d)*
1489  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, p1d));
1490 
1491  default:
1492  libmesh_error_msg("Invalid shape function derivative j = " << j);
1493  }
1494  }
1495 
1496  // G. Bedrosian, "Shape functions and integration formulas for
1497  // three-dimensional finite element analysis", Int. J. Numerical
1498  // Methods Engineering, vol 35, p. 95-108, 1992.
1499  case PYRAMID13:
1500  {
1501  libmesh_assert_less (i, 13);
1502 
1503  const Real xi = p(0);
1504  const Real eta = p(1);
1505  const Real zeta = p(2);
1506  const Real eps = 1.e-35;
1507 
1508  // Denominators are perturbed by epsilon to avoid
1509  // divide-by-zero issues.
1510  Real
1511  den = (-1. + zeta + eps),
1512  den2 = den*den,
1513  xi2 = xi*xi,
1514  eta2 = eta*eta,
1515  zeta2 = zeta*zeta,
1516  zeta3 = zeta2*zeta;
1517 
1518  switch (j)
1519  {
1520  // d/dxi
1521  case 0:
1522  switch(i)
1523  {
1524  case 0:
1525  return 0.25*(-zeta - eta + 2.*eta*zeta - 2.*xi + 2.*zeta*xi + 2.*eta*xi + zeta2 + eta2)/den;
1526 
1527  case 1:
1528  return -0.25*(-zeta - eta + 2.*eta*zeta + 2.*xi - 2.*zeta*xi - 2.*eta*xi + zeta2 + eta2)/den;
1529 
1530  case 2:
1531  return -0.25*(-zeta + eta - 2.*eta*zeta + 2.*xi - 2.*zeta*xi + 2.*eta*xi + zeta2 + eta2)/den;
1532 
1533  case 3:
1534  return 0.25*(-zeta + eta - 2.*eta*zeta - 2.*xi + 2.*zeta*xi - 2.*eta*xi + zeta2 + eta2)/den;
1535 
1536  case 4:
1537  return 0.;
1538 
1539  case 5:
1540  return -(-1. + eta + zeta)*xi/den;
1541 
1542  case 6:
1543  return 0.5*(-1. + eta + zeta)*(1. + eta - zeta)/den;
1544 
1545  case 7:
1546  return (1. + eta - zeta)*xi/den;
1547 
1548  case 8:
1549  return -0.5*(-1. + eta + zeta)*(1. + eta - zeta)/den;
1550 
1551  case 9:
1552  return -(-1. + eta + zeta)*zeta/den;
1553 
1554  case 10:
1555  return (-1. + eta + zeta)*zeta/den;
1556 
1557  case 11:
1558  return -(1. + eta - zeta)*zeta/den;
1559 
1560  case 12:
1561  return (1. + eta - zeta)*zeta/den;
1562 
1563  default:
1564  libmesh_error_msg("Invalid i = " << i);
1565  }
1566 
1567  // d/deta
1568  case 1:
1569  switch(i)
1570  {
1571  case 0:
1572  return 0.25*(-zeta - 2.*eta + 2.*eta*zeta - xi + 2.*zeta*xi + 2.*eta*xi + zeta2 + xi2)/den;
1573 
1574  case 1:
1575  return -0.25*(zeta + 2.*eta - 2.*eta*zeta - xi + 2.*zeta*xi + 2.*eta*xi - zeta2 - xi2)/den;
1576 
1577  case 2:
1578  return -0.25*(-zeta + 2.*eta - 2.*eta*zeta + xi - 2.*zeta*xi + 2.*eta*xi + zeta2 + xi2)/den;
1579 
1580  case 3:
1581  return 0.25*(zeta - 2.*eta + 2.*eta*zeta + xi - 2.*zeta*xi + 2.*eta*xi - zeta2 - xi2)/den;
1582 
1583  case 4:
1584  return 0.;
1585 
1586  case 5:
1587  return -0.5*(-1. + xi + zeta)*(1. + xi - zeta)/den;
1588 
1589  case 6:
1590  return (1. + xi - zeta)*eta/den;
1591 
1592  case 7:
1593  return 0.5*(-1. + xi + zeta)*(1. + xi - zeta)/den;
1594 
1595  case 8:
1596  return -(-1. + xi + zeta)*eta/den;
1597 
1598  case 9:
1599  return -(-1. + xi + zeta)*zeta/den;
1600 
1601  case 10:
1602  return (1. + xi - zeta)*zeta/den;
1603 
1604  case 11:
1605  return -(1. + xi - zeta)*zeta/den;
1606 
1607  case 12:
1608  return (-1. + xi + zeta)*zeta/den;
1609 
1610  default:
1611  libmesh_error_msg("Invalid i = " << i);
1612  }
1613 
1614  // d/dzeta
1615  case 2:
1616  {
1617  switch(i)
1618  {
1619  case 0:
1620  return -0.25*(xi + eta + 1.)*(-1. + 2.*zeta - zeta2 + eta*xi)/den2;
1621 
1622  case 1:
1623  return 0.25*(eta - xi + 1.)*(1. - 2.*zeta + zeta2 + eta*xi)/den2;
1624 
1625  case 2:
1626  return 0.25*(xi + eta - 1.)*(-1. + 2.*zeta - zeta2 + eta*xi)/den2;
1627 
1628  case 3:
1629  return -0.25*(eta - xi - 1.)*(1. - 2.*zeta + zeta2 + eta*xi)/den2;
1630 
1631  case 4:
1632  return 4.*zeta - 1.;
1633 
1634  case 5:
1635  return 0.5*(-2 + eta + 6.*zeta + eta*xi2 + eta*zeta2 - 6.*zeta2 + 2.*zeta3 - 2.*eta*zeta)/den2;
1636 
1637  case 6:
1638  return -0.5*(2 - 6.*zeta + xi + xi*zeta2 + eta2*xi + 6.*zeta2 - 2.*zeta3 - 2.*zeta*xi)/den2;
1639 
1640  case 7:
1641  return -0.5*(2 + eta - 6.*zeta + eta*xi2 + eta*zeta2 + 6.*zeta2 - 2.*zeta3 - 2.*eta*zeta)/den2;
1642 
1643  case 8:
1644  return 0.5*(-2 + 6.*zeta + xi + xi*zeta2 + eta2*xi - 6.*zeta2 + 2.*zeta3 - 2.*zeta*xi)/den2;
1645 
1646  case 9:
1647  return (1. - eta - 4.*zeta - xi - xi*zeta2 - eta*zeta2 + eta*xi + 5.*zeta2 - 2.*zeta3 + 2.*eta*zeta + 2.*zeta*xi)/den2;
1648 
1649  case 10:
1650  return -(-1. + eta + 4.*zeta - xi - xi*zeta2 + eta*zeta2 + eta*xi - 5.*zeta2 + 2.*zeta3 - 2.*eta*zeta + 2.*zeta*xi)/den2;
1651 
1652  case 11:
1653  return (1. + eta - 4.*zeta + xi + xi*zeta2 + eta*zeta2 + eta*xi + 5.*zeta2 - 2.*zeta3 - 2.*eta*zeta - 2.*zeta*xi)/den2;
1654 
1655  case 12:
1656  return -(-1. - eta + 4.*zeta + xi + xi*zeta2 - eta*zeta2 + eta*xi - 5.*zeta2 + 2.*zeta3 + 2.*eta*zeta - 2.*zeta*xi)/den2;
1657 
1658  default:
1659  libmesh_error_msg("Invalid i = " << i);
1660  }
1661  }
1662 
1663  default:
1664  libmesh_error_msg("Invalid j = " << j);
1665  }
1666  }
1667 
1668  // Quadratic shape functions, as defined in R. Graglia, "Higher order
1669  // bases on pyramidal elements", IEEE Trans Antennas and Propagation,
1670  // vol 47, no 5, May 1999.
1671  case PYRAMID14:
1672  {
1673  libmesh_assert_less (i, 14);
1674 
1675  const Real xi = p(0);
1676  const Real eta = p(1);
1677  const Real zeta = p(2);
1678  const Real eps = 1.e-35;
1679 
1680  // The "normalized coordinates" defined by Graglia. These are
1681  // the planes which define the faces of the pyramid.
1682  Real
1683  p1 = 0.5*(1. - eta - zeta), // back
1684  p2 = 0.5*(1. + xi - zeta), // left
1685  p3 = 0.5*(1. + eta - zeta), // front
1686  p4 = 0.5*(1. - xi - zeta); // right
1687 
1688  // Denominators are perturbed by epsilon to avoid
1689  // divide-by-zero issues.
1690  Real
1691  den = (-1. + zeta + eps),
1692  den2 = den*den,
1693  den3 = den2*den;
1694 
1695  switch (j)
1696  {
1697  // d/dxi
1698  case 0:
1699  switch(i)
1700  {
1701  case 0:
1702  return 0.5*p1*(-xi*eta + zeta - zeta*zeta + 2.*p4*eta)/den2;
1703 
1704  case 1:
1705  return -0.5*p1*(xi*eta + zeta - zeta*zeta + 2.*p2*eta)/den2;
1706 
1707  case 2:
1708  return 0.5*p3*(xi*eta - zeta + zeta*zeta + 2.*p2*eta)/den2;
1709 
1710  case 3:
1711  return -0.5*p3*(-xi*eta - zeta + zeta*zeta + 2.*p4*eta)/den2;
1712 
1713  case 4:
1714  return 0.;
1715 
1716  case 5:
1717  return 2.*p1*eta*xi/den2;
1718 
1719  case 6:
1720  return 2.*p1*p3*(xi + 2.*p2)/den2;
1721 
1722  case 7:
1723  return -2.*p3*eta*xi/den2;
1724 
1725  case 8:
1726  return -2.*p1*p3*(-xi + 2.*p4)/den2;
1727 
1728  case 9:
1729  return 2.*p1*zeta/den;
1730 
1731  case 10:
1732  return -2.*p1*zeta/den;
1733 
1734  case 11:
1735  return -2.*p3*zeta/den;
1736 
1737  case 12:
1738  return 2.*p3*zeta/den;
1739 
1740  case 13:
1741  return -8.*p1*p3*xi/den2;
1742 
1743  default:
1744  libmesh_error_msg("Invalid i = " << i);
1745  }
1746 
1747  // d/deta
1748  case 1:
1749  switch(i)
1750  {
1751  case 0:
1752  return -0.5*p4*(xi*eta - zeta + zeta*zeta - 2.*p1*xi)/den2;
1753 
1754  case 1:
1755  return 0.5*p2*(xi*eta + zeta - zeta*zeta - 2.*p1*xi)/den2;
1756 
1757  case 2:
1758  return 0.5*p2*(xi*eta - zeta + zeta*zeta + 2.*p3*xi)/den2;
1759 
1760  case 3:
1761  return -0.5*p4*(xi*eta + zeta - zeta*zeta + 2.*p3*xi)/den2;
1762 
1763  case 4:
1764  return 0.;
1765 
1766  case 5:
1767  return 2.*p2*p4*(eta - 2.*p1)/den2;
1768 
1769  case 6:
1770  return -2.*p2*xi*eta/den2;
1771 
1772  case 7:
1773  return 2.*p2*p4*(eta + 2.*p3)/den2;
1774 
1775  case 8:
1776  return 2.*p4*xi*eta/den2;
1777 
1778  case 9:
1779  return 2.*p4*zeta/den;
1780 
1781  case 10:
1782  return 2.*p2*zeta/den;
1783 
1784  case 11:
1785  return -2.*p2*zeta/den;
1786 
1787  case 12:
1788  return -2.*p4*zeta/den;
1789 
1790  case 13:
1791  return -8.*p2*p4*eta/den2;
1792 
1793  default:
1794  libmesh_error_msg("Invalid i = " << i);
1795  }
1796 
1797 
1798  // d/dzeta
1799  case 2:
1800  {
1801  switch(i)
1802  {
1803  case 0:
1804  return -0.5*p1*(xi*eta - zeta + zeta*zeta)/den2
1805  - 0.5*p4*(xi*eta - zeta + zeta*zeta)/den2
1806  + p4*p1*(2.*zeta - 1)/den2
1807  - 2.*p4*p1*(xi*eta - zeta + zeta*zeta)/den3;
1808 
1809  case 1:
1810  return 0.5*p2*(xi*eta + zeta - zeta*zeta)/den2
1811  + 0.5*p1*(xi*eta + zeta - zeta*zeta)/den2
1812  - p1*p2*(1 - 2.*zeta)/den2
1813  + 2.*p1*p2*(xi*eta + zeta - zeta*zeta)/den3;
1814 
1815  case 2:
1816  return -0.5*p3*(xi*eta - zeta + zeta*zeta)/den2
1817  - 0.5*p2*(xi*eta - zeta + zeta*zeta)/den2
1818  + p2*p3*(2.*zeta - 1)/den2
1819  - 2.*p2*p3*(xi*eta - zeta + zeta*zeta)/den3;
1820 
1821  case 3:
1822  return 0.5*p4*(xi*eta + zeta - zeta*zeta)/den2
1823  + 0.5*p3*(xi*eta + zeta - zeta*zeta)/den2
1824  - p3*p4*(1 - 2.*zeta)/den2
1825  + 2.*p3*p4*(xi*eta + zeta - zeta*zeta)/den3;
1826 
1827  case 4:
1828  return 4.*zeta - 1.;
1829 
1830  case 5:
1831  return 2.*p4*p1*eta/den2
1832  + 2.*p2*p4*eta/den2
1833  + 2.*p1*p2*eta/den2
1834  + 8.*p2*p1*p4*eta/den3;
1835 
1836  case 6:
1837  return -2.*p2*p3*xi/den2
1838  - 2.*p1*p3*xi/den2
1839  - 2.*p1*p2*xi/den2
1840  - 8.*p1*p2*p3*xi/den3;
1841 
1842  case 7:
1843  return -2.*p3*p4*eta/den2
1844  - 2.*p2*p4*eta/den2
1845  - 2.*p2*p3*eta/den2
1846  - 8.*p2*p3*p4*eta/den3;
1847 
1848  case 8:
1849  return 2.*p4*p1*xi/den2
1850  + 2.*p1*p3*xi/den2
1851  + 2.*p3*p4*xi/den2
1852  + 8.*p3*p4*p1*xi/den3;
1853 
1854  case 9:
1855  return 2.*p4*zeta/den
1856  + 2.*p1*zeta/den
1857  - 4.*p1*p4/den
1858  + 4.*p1*p4*zeta/den2;
1859 
1860  case 10:
1861  return 2.*p1*zeta/den
1862  + 2.*p2*zeta/den
1863  - 4.*p2*p1/den
1864  + 4.*p2*p1*zeta/den2;
1865 
1866  case 11:
1867  return 2.*p2*zeta/den
1868  + 2.*p3*zeta/den
1869  - 4.*p3*p2/den
1870  + 4.*p3*p2*zeta/den2;
1871 
1872  case 12:
1873  return 2.*p3*zeta/den
1874  + 2.*p4*zeta/den
1875  - 4.*p4*p3/den
1876  + 4.*p4*p3*zeta/den2;
1877 
1878  case 13:
1879  return -8.*p2*p3*p4/den2
1880  - 8.*p3*p4*p1/den2
1881  - 8.*p2*p1*p4/den2
1882  - 8.*p1*p2*p3/den2
1883  - 32.*p1*p2*p3*p4/den3;
1884 
1885  default:
1886  libmesh_error_msg("Invalid i = " << i);
1887  }
1888  }
1889 
1890  default:
1891  libmesh_error_msg("Invalid j = " << j);
1892  }
1893  }
1894 
1895 
1896  default:
1897  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
1898  }
1899  }
1900 
1901 
1902  // unsupported order
1903  default:
1904  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << order);
1905  }
1906 
1907 #endif
1908 
1909  libmesh_error_msg("We'll never get here!");
1910  return 0.;
1911 }
PetscErrorCode Vec x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
RealGradient libMesh::FE< 2, LAGRANGE_VEC >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 602 of file fe_lagrange_vec.C.

References libMesh::Real, and libMesh::FE< Dim, T >::shape_deriv().

605 {
606  Real value = FE<2,LAGRANGE>::shape_deriv( type, order, i/2, j, p );
607 
608  switch( i%2 )
609  {
610  case 0:
611  return libMesh::RealGradient( value );
612 
613  case 1:
614  return libMesh::RealGradient( Real(0), value );
615 
616  default:
617  libmesh_error_msg("i%2 must be either 0 or 1!");
618  }
619 
620  //dummy
621  return libMesh::RealGradient();
622 }
RealVectorValue RealGradient
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
RealGradient libMesh::FE< 0, NEDELEC_ONE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 605 of file fe_nedelec_one.C.

607 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
RealGradient libMesh::FE< 0, NEDELEC_ONE >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 609 of file fe_nedelec_one.C.

611 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
RealGradient libMesh::FE< 1, NEDELEC_ONE >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 628 of file fe_nedelec_one.C.

630 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
RealGradient libMesh::FE< 1, NEDELEC_ONE >::shape_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 632 of file fe_nedelec_one.C.

634 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
Real libMesh::FE< 3, MONOMIAL >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 640 of file fe_monomial_shape_3D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

645 {
646  libmesh_assert(elem);
647 
648  // call the orientation-independent shape function derivatives
649  return FE<3,MONOMIAL>::shape_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
650 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
RealGradient libMesh::FE< 3, LAGRANGE_VEC >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 670 of file fe_lagrange_vec.C.

References libMesh::Real, and libMesh::FE< Dim, T >::shape_deriv().

673 {
674  Real value = FE<3,LAGRANGE>::shape_deriv( type, order, i/3, j, p );
675 
676  switch( i%3 )
677  {
678  case 0:
679  return libMesh::RealGradient( value );
680 
681  case 1:
682  return libMesh::RealGradient( Real(0), value );
683 
684  case 2:
685  return libMesh::RealGradient( Real(0), Real(0), value );
686 
687  default:
688  libmesh_error_msg("i%3 must be 0, 1, or 2!");
689  }
690 
691  //dummy
692  return libMesh::RealGradient();
693 }
RealVectorValue RealGradient
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, L2_HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 706 of file fe_l2_hierarchic_shape_3D.C.

711 {
712  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge and face orientation is needed.");
713  return 0.;
714 }
template<>
Real libMesh::FE< 3, HIERARCHIC >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 706 of file fe_hierarchic_shape_3D.C.

711 {
712  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge and face orientation is needed.");
713  return 0.;
714 }
template<>
Real libMesh::FE< 3, L2_HIERARCHIC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 719 of file fe_l2_hierarchic_shape_3D.C.

References libMesh::libmesh_assert(), and libMesh::Real.

724 {
725 #if LIBMESH_DIM == 3
726  libmesh_assert(elem);
727 
728  libmesh_assert_less (j, 3);
729 
730  // cheat by using finite difference approximations:
731  const Real eps = 1.e-6;
732  Point pp, pm;
733 
734  switch (j)
735  {
736  // d()/dxi
737  case 0:
738  {
739  pp = Point(p(0)+eps, p(1), p(2));
740  pm = Point(p(0)-eps, p(1), p(2));
741  break;
742  }
743 
744  // d()/deta
745  case 1:
746  {
747  pp = Point(p(0), p(1)+eps, p(2));
748  pm = Point(p(0), p(1)-eps, p(2));
749  break;
750  }
751 
752  // d()/dzeta
753  case 2:
754  {
755  pp = Point(p(0), p(1), p(2)+eps);
756  pm = Point(p(0), p(1), p(2)-eps);
757  break;
758  }
759 
760  default:
761  libmesh_error_msg("Invalid derivative index j = " << j);
762  }
763 
764  return (FE<3,L2_HIERARCHIC>::shape(elem, order, i, pp) -
765  FE<3,L2_HIERARCHIC>::shape(elem, order, i, pm))/2./eps;
766 #endif
767 
768  libmesh_error_msg("We'll never get here!");
769  return 0.;
770 }
libmesh_assert(remote_elem)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, HIERARCHIC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 719 of file fe_hierarchic_shape_3D.C.

References libMesh::libmesh_assert(), and libMesh::Real.

724 {
725 #if LIBMESH_DIM == 3
726  libmesh_assert(elem);
727 
728  libmesh_assert_less (j, 3);
729 
730  // cheat by using finite difference approximations:
731  const Real eps = 1.e-6;
732  Point pp, pm;
733 
734  switch (j)
735  {
736  // d()/dxi
737  case 0:
738  {
739  pp = Point(p(0)+eps, p(1), p(2));
740  pm = Point(p(0)-eps, p(1), p(2));
741  break;
742  }
743 
744  // d()/deta
745  case 1:
746  {
747  pp = Point(p(0), p(1)+eps, p(2));
748  pm = Point(p(0), p(1)-eps, p(2));
749  break;
750  }
751 
752  // d()/dzeta
753  case 2:
754  {
755  pp = Point(p(0), p(1), p(2)+eps);
756  pm = Point(p(0), p(1), p(2)-eps);
757  break;
758  }
759 
760  default:
761  libmesh_error_msg("Invalid derivative index j = " << j);
762  }
763 
764  return (FE<3,HIERARCHIC>::shape(elem, order, i, pp) -
765  FE<3,HIERARCHIC>::shape(elem, order, i, pm))/2./eps;
766 #endif
767 
768  libmesh_error_msg("We'll never get here!");
769  return 0.;
770 }
libmesh_assert(remote_elem)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
RealGradient libMesh::FE< 0, LAGRANGE_VEC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 728 of file fe_lagrange_vec.C.

References libMesh::Elem::p_level(), libMesh::Real, libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

731 {
732  Real value = FE<0,LAGRANGE>::shape_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
733  return libMesh::RealGradient( value );
734 }
RealVectorValue RealGradient
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, SZABAB >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 740 of file fe_szabab_shape_2D.C.

745 {
746  libmesh_error_msg("Szabo-Babuska polynomials require the element type \nbecause edge orientation is needed.");
747  return 0.;
748 }
template<>
Real libMesh::FE< 2, SUBDIVISION >::shape_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 750 of file fe_subdivision_2D.C.

References libMesh::FOURTH, and libMesh::TRI3SUBDIVISION.

755 {
756  switch (order)
757  {
758  case FOURTH:
759  {
760  switch (type)
761  {
762  case TRI3SUBDIVISION:
763  libmesh_assert_less(i, 12);
764  return FESubdivision::regular_shape_deriv(i,j,p(0),p(1));
765  default:
766  libmesh_error_msg("ERROR: Unsupported element type!");
767  }
768  }
769  default:
770  libmesh_error_msg("ERROR: Unsupported polynomial order!");
771  }
772 
773  libmesh_error_msg("We'll never get here!");
774  return 0.;
775 }
static Real regular_shape_deriv(const unsigned int i, const unsigned int j, const Real v, const Real w)
template<>
RealGradient libMesh::FE< 1, LAGRANGE_VEC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 750 of file fe_lagrange_vec.C.

References libMesh::Elem::p_level(), libMesh::Real, libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

753 {
754  Real value = FE<1,LAGRANGE>::shape_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
755  return libMesh::RealGradient( value );
756 }
RealVectorValue RealGradient
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, SZABAB >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 753 of file fe_szabab_shape_2D.C.

References libMesh::EDGE3, libMesh::FIFTH, libMesh::FIRST, libMesh::FOURTH, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::Real, libMesh::SECOND, libMesh::SEVENTH, libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::SIXTH, libMesh::THIRD, libMesh::TRI3, libMesh::TRI6, and libMesh::Elem::type().

758 {
759  libmesh_assert(elem);
760 
761  const ElemType type = elem->type();
762 
763  const Order totalorder = static_cast<Order>(order + elem->p_level());
764 
765  switch (totalorder)
766  {
767 
768  // 1st & 2nd-order Szabo-Babuska.
769  case FIRST:
770  case SECOND:
771  {
772  switch (type)
773  {
774 
775  // Szabo-Babuska shape functions on the triangle.
776  case TRI3:
777  case TRI6:
778  {
779  // Here we use finite differences to compute the derivatives!
780  const Real eps = 1.e-6;
781 
782  libmesh_assert_less (i, 6);
783  libmesh_assert_less (j, 2);
784 
785  switch (j)
786  {
787  // d()/dxi
788  case 0:
789  {
790  const Point pp(p(0)+eps, p(1));
791  const Point pm(p(0)-eps, p(1));
792 
793  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
794  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
795  }
796 
797  // d()/deta
798  case 1:
799  {
800  const Point pp(p(0), p(1)+eps);
801  const Point pm(p(0), p(1)-eps);
802 
803  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
804  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
805  }
806 
807  default:
808  libmesh_error_msg("Invalid j = " << j);
809  }
810  }
811 
812 
813 
814  // Szabo-Babuska shape functions on the quadrilateral.
815  case QUAD4:
816  case QUAD8:
817  case QUAD9:
818  {
819  // Compute quad shape functions as a tensor-product
820  const Real xi = p(0);
821  const Real eta = p(1);
822 
823  libmesh_assert_less (i, 9);
824 
825  // 0 1 2 3 4 5 6 7 8
826  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
827  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
828 
829  switch (j)
830  {
831  // d()/dxi
832  case 0:
833  return (FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
834  FE<1,SZABAB>::shape (EDGE3, totalorder, i1[i], eta));
835 
836  // d()/deta
837  case 1:
838  return (FE<1,SZABAB>::shape (EDGE3, totalorder, i0[i], xi)*
839  FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta));
840 
841  default:
842  libmesh_error_msg("Invalid j = " << j);
843  }
844  }
845 
846  default:
847  libmesh_error_msg("Invalid element type = " << type);
848  }
849  }
850 
851 
852 
853  // 3rd-order Szabo-Babuska.
854  case THIRD:
855  {
856  switch (type)
857  {
858  // Szabo-Babuska shape functions on the triangle.
859  case TRI6:
860  {
861  // Here we use finite differences to compute the derivatives!
862  const Real eps = 1.e-6;
863 
864  libmesh_assert_less (i, 10);
865  libmesh_assert_less (j, 2);
866 
867  switch (j)
868  {
869  // d()/dxi
870  case 0:
871  {
872  const Point pp(p(0)+eps, p(1));
873  const Point pm(p(0)-eps, p(1));
874 
875  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
876  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
877  }
878 
879  // d()/deta
880  case 1:
881  {
882  const Point pp(p(0), p(1)+eps);
883  const Point pm(p(0), p(1)-eps);
884 
885  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
886  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
887  }
888 
889 
890  default:
891  libmesh_error_msg("Invalid j = " << j);
892  }
893  }
894 
895 
896  // Szabo-Babuska shape functions on the quadrilateral.
897  case QUAD8:
898  case QUAD9:
899  {
900  // Compute quad shape functions as a tensor-product
901  const Real xi = p(0);
902  const Real eta = p(1);
903 
904  libmesh_assert_less (i, 16);
905 
906  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
907  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 1, 1, 2, 3, 0, 0, 2, 3, 2, 3};
908  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 2, 2, 3, 3};
909 
910  Real f=1.;
911 
912  switch(i)
913  {
914  case 5: // edge 0 points
915  if (elem->point(0) > elem->point(1))f = -1.;
916  break;
917  case 7: // edge 1 points
918  if (elem->point(1) > elem->point(2))f = -1.;
919  break;
920  case 9: // edge 2 points
921  if (elem->point(3) > elem->point(2))f = -1.;
922  break;
923  case 11: // edge 3 points
924  if (elem->point(0) > elem->point(3))f = -1.;
925  break;
926 
927  default:
928  // Everything else keeps f=1
929  break;
930  }
931 
932 
933  switch (j)
934  {
935  // d()/dxi
936  case 0:
937  return f*(FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
938  FE<1,SZABAB>::shape (EDGE3, totalorder, i1[i], eta));
939 
940  // d()/deta
941  case 1:
942  return f*(FE<1,SZABAB>::shape (EDGE3, totalorder, i0[i], xi)*
943  FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta));
944 
945  default:
946  libmesh_error_msg("Invalid j = " << j);
947  }
948  }
949 
950  default:
951  libmesh_error_msg("Invalid element type = " << type);
952  }
953  }
954 
955 
956 
957 
958  // 4th-order Szabo-Babuska.
959  case FOURTH:
960  {
961  switch (type)
962  {
963 
964  // Szabo-Babuska shape functions on the triangle.
965  case TRI6:
966  {
967  // Here we use finite differences to compute the derivatives!
968  const Real eps = 1.e-6;
969 
970  libmesh_assert_less (i, 15);
971  libmesh_assert_less (j, 2);
972 
973  switch (j)
974  {
975  // d()/dxi
976  case 0:
977  {
978  const Point pp(p(0)+eps, p(1));
979  const Point pm(p(0)-eps, p(1));
980 
981  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
982  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
983  }
984 
985  // d()/deta
986  case 1:
987  {
988  const Point pp(p(0), p(1)+eps);
989  const Point pm(p(0), p(1)-eps);
990 
991  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
992  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
993  }
994 
995 
996  default:
997  libmesh_error_msg("Invalid j = " << j);
998  }
999  }
1000 
1001 
1002 
1003  // Szabo-Babuska shape functions on the quadrilateral.
1004  case QUAD8:
1005  case QUAD9:
1006  {
1007  // Compute quad shape functions as a tensor-product
1008  const Real xi = p(0);
1009  const Real eta = p(1);
1010 
1011  libmesh_assert_less (i, 25);
1012 
1013  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
1014  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4};
1015  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4};
1016 
1017  Real f=1.;
1018 
1019  switch(i)
1020  {
1021  case 5: // edge 0 points
1022  if (elem->point(0) > elem->point(1))f = -1.;
1023  break;
1024  case 8: // edge 1 points
1025  if (elem->point(1) > elem->point(2))f = -1.;
1026  break;
1027  case 11: // edge 2 points
1028  if (elem->point(3) > elem->point(2))f = -1.;
1029  break;
1030  case 14: // edge 3 points
1031  if (elem->point(0) > elem->point(3))f = -1.;
1032  break;
1033 
1034  default:
1035  // Everything else keeps f=1
1036  break;
1037  }
1038 
1039 
1040  switch (j)
1041  {
1042  // d()/dxi
1043  case 0:
1044  return f*(FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
1045  FE<1,SZABAB>::shape (EDGE3, totalorder, i1[i], eta));
1046 
1047  // d()/deta
1048  case 1:
1049  return f*(FE<1,SZABAB>::shape (EDGE3, totalorder, i0[i], xi)*
1050  FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta));
1051 
1052  default:
1053  libmesh_error_msg("Invalid j = " << j);
1054  }
1055  }
1056 
1057  default:
1058  libmesh_error_msg("Invalid element type = " << type);
1059  }
1060  }
1061 
1062 
1063 
1064 
1065  // 5th-order Szabo-Babuska.
1066  case FIFTH:
1067  {
1068  // Szabo-Babuska shape functions on the quadrilateral.
1069  switch (type)
1070  {
1071 
1072  // Szabo-Babuska shape functions on the triangle.
1073  case TRI6:
1074  {
1075  // Here we use finite differences to compute the derivatives!
1076  const Real eps = 1.e-6;
1077 
1078  libmesh_assert_less (i, 21);
1079  libmesh_assert_less (j, 2);
1080 
1081  switch (j)
1082  {
1083  // d()/dxi
1084  case 0:
1085  {
1086  const Point pp(p(0)+eps, p(1));
1087  const Point pm(p(0)-eps, p(1));
1088 
1089  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
1090  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
1091  }
1092 
1093  // d()/deta
1094  case 1:
1095  {
1096  const Point pp(p(0), p(1)+eps);
1097  const Point pm(p(0), p(1)-eps);
1098 
1099  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
1100  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
1101  }
1102 
1103  default:
1104  libmesh_error_msg("Invalid j = " << j);
1105  }
1106  }
1107 
1108 
1109 
1110  case QUAD8:
1111  case QUAD9:
1112  {
1113  // Compute quad shape functions as a tensor-product
1114  const Real xi = p(0);
1115  const Real eta = p(1);
1116 
1117  libmesh_assert_less (i, 36);
1118 
1119  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
1120  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 0, 0, 0, 0, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5};
1121  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 2, 3, 4, 5, 1, 1, 1, 1, 2, 3, 4, 5, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5};
1122 
1123  Real f=1.;
1124 
1125  switch(i)
1126  {
1127  case 5: // edge 0 points
1128  case 7:
1129  if (elem->point(0) > elem->point(1))f = -1.;
1130  break;
1131  case 9: // edge 1 points
1132  case 11:
1133  if (elem->point(1) > elem->point(2))f = -1.;
1134  break;
1135  case 13: // edge 2 points
1136  case 15:
1137  if (elem->point(3) > elem->point(2))f = -1.;
1138  break;
1139  case 14: // edge 3 points
1140  case 19:
1141  if (elem->point(0) > elem->point(3))f = -1.;
1142  break;
1143 
1144  default:
1145  // Everything else keeps f=1
1146  break;
1147  }
1148 
1149 
1150  switch (j)
1151  {
1152  // d()/dxi
1153  case 0:
1154  return f*(FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
1155  FE<1,SZABAB>::shape (EDGE3, totalorder, i1[i], eta));
1156 
1157  // d()/deta
1158  case 1:
1159  return f*(FE<1,SZABAB>::shape (EDGE3, totalorder, i0[i], xi)*
1160  FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta));
1161 
1162  default:
1163  libmesh_error_msg("Invalid j = " << j);
1164  }
1165  }
1166 
1167  default:
1168  libmesh_error_msg("Invalid element type = " << type);
1169  }
1170  }
1171 
1172 
1173  // 6th-order Szabo-Babuska.
1174  case SIXTH:
1175  {
1176  // Szabo-Babuska shape functions on the quadrilateral.
1177  switch (type)
1178  {
1179 
1180  // Szabo-Babuska shape functions on the triangle.
1181  case TRI6:
1182  {
1183  // Here we use finite differences to compute the derivatives!
1184  const Real eps = 1.e-6;
1185 
1186  libmesh_assert_less (i, 28);
1187  libmesh_assert_less (j, 2);
1188 
1189  switch (j)
1190  {
1191  // d()/dxi
1192  case 0:
1193  {
1194  const Point pp(p(0)+eps, p(1));
1195  const Point pm(p(0)-eps, p(1));
1196 
1197  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
1198  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
1199  }
1200 
1201  // d()/deta
1202  case 1:
1203  {
1204  const Point pp(p(0), p(1)+eps);
1205  const Point pm(p(0), p(1)-eps);
1206 
1207  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
1208  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
1209  }
1210 
1211  default:
1212  libmesh_error_msg("Invalid j = " << j);
1213  }
1214  }
1215 
1216 
1217 
1218  case QUAD8:
1219  case QUAD9:
1220  {
1221  // Compute quad shape functions as a tensor-product
1222  const Real xi = p(0);
1223  const Real eta = p(1);
1224 
1225  libmesh_assert_less (i, 49);
1226 
1227  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
1228  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6};
1229  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6};
1230 
1231  Real f=1.;
1232 
1233  switch(i)
1234  {
1235  case 5: // edge 0 points
1236  case 7:
1237  if (elem->point(0) > elem->point(1))f = -1.;
1238  break;
1239  case 10: // edge 1 points
1240  case 12:
1241  if (elem->point(1) > elem->point(2))f = -1.;
1242  break;
1243  case 15: // edge 2 points
1244  case 17:
1245  if (elem->point(3) > elem->point(2))f = -1.;
1246  break;
1247  case 20: // edge 3 points
1248  case 22:
1249  if (elem->point(0) > elem->point(3))f = -1.;
1250  break;
1251 
1252  default:
1253  // Everything else keeps f=1
1254  break;
1255  }
1256 
1257 
1258  switch (j)
1259  {
1260  // d()/dxi
1261  case 0:
1262  return f*(FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
1263  FE<1,SZABAB>::shape (EDGE3, totalorder, i1[i], eta));
1264 
1265  // d()/deta
1266  case 1:
1267  return f*(FE<1,SZABAB>::shape (EDGE3, totalorder, i0[i], xi)*
1268  FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta));
1269 
1270  default:
1271  libmesh_error_msg("Invalid j = " << j);
1272  }
1273  }
1274 
1275  default:
1276  libmesh_error_msg("Invalid element type = " << type);
1277  }
1278  }
1279 
1280 
1281  // 7th-order Szabo-Babuska.
1282  case SEVENTH:
1283  {
1284  // Szabo-Babuska shape functions on the quadrilateral.
1285  switch (type)
1286  {
1287 
1288  // Szabo-Babuska shape functions on the triangle.
1289  case TRI6:
1290  {
1291  // Here we use finite differences to compute the derivatives!
1292  const Real eps = 1.e-6;
1293 
1294  libmesh_assert_less (i, 36);
1295  libmesh_assert_less (j, 2);
1296 
1297  switch (j)
1298  {
1299  // d()/dxi
1300  case 0:
1301  {
1302  const Point pp(p(0)+eps, p(1));
1303  const Point pm(p(0)-eps, p(1));
1304 
1305  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
1306  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
1307  }
1308 
1309  // d()/deta
1310  case 1:
1311  {
1312  const Point pp(p(0), p(1)+eps);
1313  const Point pm(p(0), p(1)-eps);
1314 
1315  return (FE<2,SZABAB>::shape(elem, order, i, pp) -
1316  FE<2,SZABAB>::shape(elem, order, i, pm))/2./eps;
1317  }
1318 
1319  default:
1320  libmesh_error_msg("Invalid j = " << j);
1321  }
1322  }
1323 
1324 
1325 
1326  case QUAD8:
1327  case QUAD9:
1328  {
1329  // Compute quad shape functions as a tensor-product
1330  const Real xi = p(0);
1331  const Real eta = p(1);
1332 
1333  libmesh_assert_less (i, 64);
1334 
1335  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
1336  static const unsigned int i0[] = {0, 1, 1, 0, 2, 3, 4, 5, 6, 7, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7, 2, 3, 4, 5, 6, 7};
1337  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, 7, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7};
1338 
1339  Real f=1.;
1340 
1341  switch(i)
1342  {
1343  case 5: // edge 0 points
1344  case 7:
1345  case 9:
1346  if (elem->point(0) > elem->point(1))f = -1.;
1347  break;
1348  case 11: // edge 1 points
1349  case 13:
1350  case 15:
1351  if (elem->point(1) > elem->point(2))f = -1.;
1352  break;
1353  case 17: // edge 2 points
1354  case 19:
1355  case 21:
1356  if (elem->point(3) > elem->point(2))f = -1.;
1357  break;
1358  case 23: // edge 3 points
1359  case 25:
1360  case 27:
1361  if (elem->point(0) > elem->point(3))f = -1.;
1362  break;
1363 
1364  default:
1365  // Everything else keeps f=1
1366  break;
1367  }
1368 
1369 
1370  switch (j)
1371  {
1372  // d()/dxi
1373  case 0:
1374  return f*(FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
1375  FE<1,SZABAB>::shape (EDGE3, totalorder, i1[i], eta));
1376 
1377  // d()/deta
1378  case 1:
1379  return f*(FE<1,SZABAB>::shape (EDGE3, totalorder, i0[i], xi)*
1380  FE<1,SZABAB>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta));
1381 
1382  default:
1383  libmesh_error_msg("Invalid j = " << j);
1384  }
1385  }
1386 
1387  default:
1388  libmesh_error_msg("Invalid element type = " << type);
1389  }
1390  }
1391 
1392 
1393 
1394  // by default throw an error;call the orientation-independent shape functions
1395  default:
1396  libmesh_error_msg("ERROR: Unsupported polynomial order!");
1397  }
1398 
1399  libmesh_error_msg("We'll never get here!");
1400  return 0.;
1401 }
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, SUBDIVISION >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 780 of file fe_subdivision_2D.C.

References libMesh::libmesh_assert(), and libMesh::Elem::type().

785 {
786  libmesh_assert(elem);
787  return FE<2,SUBDIVISION>::shape_deriv(elem->type(), order, i, j, p);
788 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
RealGradient libMesh::FE< 2, LAGRANGE_VEC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 786 of file fe_lagrange_vec.C.

References libMesh::Elem::p_level(), libMesh::Real, libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

789 {
790  Real value = FE<2,LAGRANGE>::shape_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i/2, j, p );
791 
792  switch( i%2 )
793  {
794  case 0:
795  return libMesh::RealGradient( value );
796 
797  case 1:
798  return libMesh::RealGradient( Real(0), value );
799 
800  default:
801  libmesh_error_msg("i%2 must be either 0 or 1!");
802  }
803 
804  //dummy
805  return libMesh::RealGradient();
806 }
RealVectorValue RealGradient
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
RealGradient libMesh::FE< 3, LAGRANGE_VEC >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 853 of file fe_lagrange_vec.C.

References libMesh::Elem::p_level(), libMesh::Real, libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

856 {
857  Real value = FE<3,LAGRANGE>::shape_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i/3, j, p );
858 
859  switch( i%3 )
860  {
861  case 0:
862  return libMesh::RealGradient( value );
863 
864  case 1:
865  return libMesh::RealGradient( Real(0), value );
866 
867  case 2:
868  return libMesh::RealGradient( Real(0), Real(0), value );
869 
870  default:
871  libmesh_error_msg("i%3 must be 0, 1, or 2!");
872  }
873 
874  //dummy
875  return libMesh::RealGradient();
876 }
RealVectorValue RealGradient
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, L2_LAGRANGE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 1201 of file fe_l2_lagrange_shape_3D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

1206 {
1207  libmesh_assert(elem);
1208 
1209  // call the orientation-independent shape function derivatives
1210  return FE<3,L2_LAGRANGE>::shape_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
1211 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 3, BERNSTEIN >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 1385 of file fe_bernstein_shape_3D.C.

1390 {
1391  libmesh_error_msg("Bernstein polynomials require the element type \nbecause edge and face orientation is needed.");
1392  return 0.;
1393 }
template<>
Real libMesh::FE< 3, BERNSTEIN >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 1398 of file fe_bernstein_shape_3D.C.

References libMesh::EDGE3, libMesh::FIRST, libMesh::FOURTH, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Real, libMesh::SECOND, libMesh::TET10, libMesh::TET4, libMesh::THIRD, and libMesh::Elem::type().

1403 {
1404 
1405 #if LIBMESH_DIM == 3
1406  libmesh_assert(elem);
1407  const ElemType type = elem->type();
1408 
1409  const Order totalorder = static_cast<Order>(order + elem->p_level());
1410 
1411  libmesh_assert_less (j, 3);
1412 
1413  switch (totalorder)
1414  {
1415  // 1st order Bernstein.
1416  case FIRST:
1417  {
1418  switch (type)
1419  {
1420  // Bernstein shape functions on the tetrahedron.
1421  case TET4:
1422  case TET10:
1423  {
1424  // I have been lazy here and am using finite differences
1425  // to compute the derivatives!
1426  const Real eps = 1.e-6;
1427 
1428  libmesh_assert_less (i, 4);
1429  libmesh_assert_less (j, 3);
1430 
1431 
1432  switch (j)
1433  {
1434  // d()/dxi
1435  case 0:
1436  {
1437  const Point pp(p(0)+eps, p(1), p(2));
1438  const Point pm(p(0)-eps, p(1), p(2));
1439 
1440  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1441  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1442  }
1443 
1444  // d()/deta
1445  case 1:
1446  {
1447  const Point pp(p(0), p(1)+eps, p(2));
1448  const Point pm(p(0), p(1)-eps, p(2));
1449 
1450  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1451  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1452  }
1453  // d()/dzeta
1454  case 2:
1455  {
1456  const Point pp(p(0), p(1), p(2)+eps);
1457  const Point pm(p(0), p(1), p(2)-eps);
1458 
1459  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1460  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1461  }
1462  default:
1463  libmesh_error_msg("Invalid derivative index j = " << j);
1464  }
1465  }
1466 
1467 
1468 
1469 
1470  // Bernstein shape functions on the hexahedral.
1471  case HEX8:
1472  case HEX20:
1473  case HEX27:
1474  {
1475  libmesh_assert_less (i, 8);
1476 
1477  // Compute hex shape functions as a tensor-product
1478  const Real xi = p(0);
1479  const Real eta = p(1);
1480  const Real zeta = p(2);
1481 
1482  // The only way to make any sense of this
1483  // is to look at the mgflo/mg2/mgf documentation
1484  // and make the cut-out cube!
1485  // 0 1 2 3 4 5 6 7
1486  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
1487  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
1488  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
1489 
1490  switch (j)
1491  {
1492  // d()/dxi
1493  case 0:
1494  return (FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
1495  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta)*
1496  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta));
1497 
1498  // d()/deta
1499  case 1:
1500  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi)*
1501  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta)*
1502  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta));
1503 
1504  // d()/dzeta
1505  case 2:
1506  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi)*
1507  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta)*
1508  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[i], 0, zeta));
1509 
1510  default:
1511  libmesh_error_msg("Invalid derivative index j = " << j);
1512  }
1513  }
1514 
1515  default:
1516  libmesh_error_msg("Invalid element type = " << type);
1517  }
1518  }
1519 
1520 
1521 
1522 
1523  case SECOND:
1524  {
1525  switch (type)
1526  {
1527  // Bernstein shape functions on the tetrahedron.
1528  case TET10:
1529  {
1530  // I have been lazy here and am using finite differences
1531  // to compute the derivatives!
1532  const Real eps = 1.e-6;
1533 
1534  libmesh_assert_less (i, 10);
1535  libmesh_assert_less (j, 3);
1536 
1537 
1538  switch (j)
1539  {
1540  // d()/dxi
1541  case 0:
1542  {
1543  const Point pp(p(0)+eps, p(1), p(2));
1544  const Point pm(p(0)-eps, p(1), p(2));
1545 
1546  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1547  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1548  }
1549 
1550  // d()/deta
1551  case 1:
1552  {
1553  const Point pp(p(0), p(1)+eps, p(2));
1554  const Point pm(p(0), p(1)-eps, p(2));
1555 
1556  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1557  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1558  }
1559  // d()/dzeta
1560  case 2:
1561  {
1562  const Point pp(p(0), p(1), p(2)+eps);
1563  const Point pm(p(0), p(1), p(2)-eps);
1564 
1565  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1566  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1567  }
1568  default:
1569  libmesh_error_msg("Invalid derivative index j = " << j);
1570  }
1571  }
1572 
1573  // Bernstein shape functions on the hexahedral.
1574  case HEX20:
1575  {
1576  libmesh_assert_less (i, 20);
1577 
1578  // Compute hex shape functions as a tensor-product
1579  const Real xi = p(0);
1580  const Real eta = p(1);
1581  const Real zeta = p(2);
1582 
1583  // The only way to make any sense of this
1584  // is to look at the mgflo/mg2/mgf documentation
1585  // and make the cut-out cube!
1586  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
1587  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
1588  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
1589  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
1590  static const Real scal20[] = {-0.25, -0.25, -0.25, -0.25, 0, 0, 0, 0, 0.5, 0.5, 0.5, 0.5, 0, 0, 0, 0, 0, 0, 0, 0};
1591  static const Real scal21[] = {-0.25, -0.25, 0, 0, -0.25, -0.25, 0, 0, 0.5, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0, 0, 0};
1592  static const Real scal22[] = {0, -0.25, -0.25, 0, 0, -0.25, -0.25, 0, 0, 0.5, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0, 0};
1593  static const Real scal23[] = {0, 0, -0.25, -0.25, 0, 0, -0.25, -0.25, 0, 0, 0.5, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0};
1594  static const Real scal24[] = {-0.25, 0, 0, -0.25, -0.25, 0, 0, -0.25, 0, 0, 0, 0.5, 0.5, 0, 0, 0.5, 0, 0, 0, 0.5};
1595  static const Real scal25[] = {0, 0, 0, 0, -0.25, -0.25, -0.25, -0.25, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0.5, 0.5, 0.5};
1596  static const Real scal26[] = {-0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25};
1597 
1598  switch (j)
1599  {
1600  // d()/dxi
1601  case 0:
1602  return (FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
1603  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta)*
1604  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta)
1605  +scal20[i]*
1606  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[20], 0, xi)*
1607  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[20], eta)*
1608  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[20], zeta)
1609  +scal21[i]*
1610  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[21], 0, xi)*
1611  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[21], eta)*
1612  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[21], zeta)
1613  +scal22[i]*
1614  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[22], 0, xi)*
1615  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[22], eta)*
1616  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[22], zeta)
1617  +scal23[i]*
1618  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[23], 0, xi)*
1619  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[23], eta)*
1620  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[23], zeta)
1621  +scal24[i]*
1622  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[24], 0, xi)*
1623  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[24], eta)*
1624  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[24], zeta)
1625  +scal25[i]*
1626  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[25], 0, xi)*
1627  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[25], eta)*
1628  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[25], zeta)
1629  +scal26[i]*
1630  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[26], 0, xi)*
1631  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[26], eta)*
1632  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[26], zeta));
1633 
1634  // d()/deta
1635  case 1:
1636  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi)*
1637  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta)*
1638  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta)
1639  +scal20[i]*
1640  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[20], xi)*
1641  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[20], 0, eta)*
1642  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[20], zeta)
1643  +scal21[i]*
1644  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[21], xi)*
1645  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[21], 0, eta)*
1646  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[21], zeta)
1647  +scal22[i]*
1648  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[22], xi)*
1649  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[22], 0, eta)*
1650  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[22], zeta)
1651  +scal23[i]*
1652  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[23], xi)*
1653  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[23], 0, eta)*
1654  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[23], zeta)
1655  +scal24[i]*
1656  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[24], xi)*
1657  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[24], 0, eta)*
1658  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[24], zeta)
1659  +scal25[i]*
1660  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[25], xi)*
1661  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[25], 0, eta)*
1662  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[25], zeta)
1663  +scal26[i]*
1664  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[26], xi)*
1665  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[26], 0, eta)*
1666  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[26], zeta));
1667 
1668  // d()/dzeta
1669  case 2:
1670  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi)*
1671  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta)*
1672  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[i], 0, zeta)
1673  +scal20[i]*
1674  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[20], xi)*
1675  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[20], eta)*
1676  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[20], 0, zeta)
1677  +scal21[i]*
1678  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[21], xi)*
1679  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[21], eta)*
1680  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[21], 0, zeta)
1681  +scal22[i]*
1682  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[22], xi)*
1683  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[22], eta)*
1684  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[22], 0, zeta)
1685  +scal23[i]*
1686  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[23], xi)*
1687  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[23], eta)*
1688  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[23], 0, zeta)
1689  +scal24[i]*
1690  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[24], xi)*
1691  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[24], eta)*
1692  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[24], 0, zeta)
1693  +scal25[i]*
1694  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[25], xi)*
1695  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[25], eta)*
1696  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[25], 0, zeta)
1697  +scal26[i]*
1698  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[26], xi)*
1699  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[26], eta)*
1700  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[26], 0, zeta));
1701 
1702  default:
1703  libmesh_error_msg("Invalid derivative index j = " << j);
1704  }
1705  }
1706 
1707  // Bernstein shape functions on the hexahedral.
1708  case HEX27:
1709  {
1710  libmesh_assert_less (i, 27);
1711 
1712  // Compute hex shape functions as a tensor-product
1713  const Real xi = p(0);
1714  const Real eta = p(1);
1715  const Real zeta = p(2);
1716 
1717  // The only way to make any sense of this
1718  // is to look at the mgflo/mg2/mgf documentation
1719  // and make the cut-out cube!
1720  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
1721  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
1722  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
1723  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
1724 
1725  switch (j)
1726  {
1727  // d()/dxi
1728  case 0:
1729  return (FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi)*
1730  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta)*
1731  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta));
1732 
1733  // d()/deta
1734  case 1:
1735  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi)*
1736  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta)*
1737  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta));
1738 
1739  // d()/dzeta
1740  case 2:
1741  return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi)*
1742  FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta)*
1743  FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[i], 0, zeta));
1744 
1745  default:
1746  libmesh_error_msg("Invalid derivative index j = " << j);
1747  }
1748  }
1749 
1750 
1751  default:
1752  libmesh_error_msg("Invalid element type = " << type);
1753  }
1754  }
1755 
1756 
1757 
1758  // 3rd-order Bernstein.
1759  case THIRD:
1760  {
1761  switch (type)
1762  {
1763 
1764  // // Bernstein shape functions derivatives.
1765  // case TET10:
1766  // {
1767  // // I have been lazy here and am using finite differences
1768  // // to compute the derivatives!
1769  // const Real eps = 1.e-6;
1770 
1771  // libmesh_assert_less (i, 20);
1772  // libmesh_assert_less (j, 3);
1773 
1774  // switch (j)
1775  // {
1776  // // d()/dxi
1777  // case 0:
1778  // {
1779  // const Point pp(p(0)+eps, p(1), p(2));
1780  // const Point pm(p(0)-eps, p(1), p(2));
1781 
1782  // return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1783  // FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1784  // }
1785 
1786  // // d()/deta
1787  // case 1:
1788  // {
1789  // const Point pp(p(0), p(1)+eps, p(2));
1790  // const Point pm(p(0), p(1)-eps, p(2));
1791 
1792  // return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1793  // FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1794  // }
1795  // // d()/dzeta
1796  // case 2:
1797  // {
1798  // const Point pp(p(0), p(1), p(2)+eps);
1799  // const Point pm(p(0), p(1), p(2)-eps);
1800 
1801  // return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1802  // FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1803  // }
1804  // default:
1805  // libmesh_error_msg("Invalid derivative index j = " << j);
1806  // }
1807 
1808 
1809  // }
1810 
1811 
1812  // Bernstein shape functions on the hexahedral.
1813  case HEX27:
1814  {
1815  // I have been lazy here and am using finite differences
1816  // to compute the derivatives!
1817  const Real eps = 1.e-6;
1818 
1819  libmesh_assert_less (i, 64);
1820  libmesh_assert_less (j, 3);
1821 
1822  switch (j)
1823  {
1824  // d()/dxi
1825  case 0:
1826  {
1827  const Point pp(p(0)+eps, p(1), p(2));
1828  const Point pm(p(0)-eps, p(1), p(2));
1829 
1830  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1831  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1832  }
1833 
1834  // d()/deta
1835  case 1:
1836  {
1837  const Point pp(p(0), p(1)+eps, p(2));
1838  const Point pm(p(0), p(1)-eps, p(2));
1839 
1840  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1841  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1842  }
1843  // d()/dzeta
1844  case 2:
1845  {
1846  const Point pp(p(0), p(1), p(2)+eps);
1847  const Point pm(p(0), p(1), p(2)-eps);
1848 
1849  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
1850  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
1851  }
1852  default:
1853  libmesh_error_msg("Invalid derivative index j = " << j);
1854  }
1855 
1856  }
1857 
1858  // // Compute hex shape functions as a tensor-product
1859  // const Real xi = p(0);
1860  // const Real eta = p(1);
1861  // const Real zeta = p(2);
1862  // Real xi_mapped = p(0);
1863  // Real eta_mapped = p(1);
1864  // Real zeta_mapped = p(2);
1865 
1866  // // The only way to make any sense of this
1867  // // is to look at the mgflo/mg2/mgf documentation
1868  // // and make the cut-out cube!
1869  // // Nodes 0 1 2 3 4 5 6 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 24 24 25 25 25 25 26 26 26 26 26 26 26 26
1870  // // DOFS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 18 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 60 62 63
1871  // static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 3, 1, 1, 2, 3, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 0, 0, 2, 3, 2, 3, 2, 3, 2, 3, 1, 1, 1, 1, 2, 3, 2, 3, 0, 0, 0, 0, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3};
1872  // static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 2, 3, 1, 1, 2, 3, 2, 2, 3, 3, 0, 0, 0, 0, 2, 3, 2, 3, 1, 1, 1, 1, 2, 3, 2, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3};
1873  // static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 2, 3, 2, 3, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3};
1874 
1875 
1876 
1877  // // handle the edge orientation
1878  // {
1879  // // Edge 0
1880  // if ((i1[i] == 0) && (i2[i] == 0))
1881  // {
1882  // if (elem->node_id(0) != std::min(elem->node_id(0), elem->node_id(1)))
1883  // xi_mapped = -xi;
1884  // }
1885  // // Edge 1
1886  // else if ((i0[i] == 1) && (i2[i] == 0))
1887  // {
1888  // if (elem->node_id(1) != std::min(elem->node_id(1), elem->node_id(2)))
1889  // eta_mapped = -eta;
1890  // }
1891  // // Edge 2
1892  // else if ((i1[i] == 1) && (i2[i] == 0))
1893  // {
1894  // if (elem->node_id(3) != std::min(elem->node_id(3), elem->node_id(2)))
1895  // xi_mapped = -xi;
1896  // }
1897  // // Edge 3
1898  // else if ((i0[i] == 0) && (i2[i] == 0))
1899  // {
1900  // if (elem->node_id(0) != std::min(elem->node_id(0), elem->node_id(3)))
1901  // eta_mapped = -eta;
1902  // }
1903  // // Edge 4
1904  // else if ((i0[i] == 0) && (i1[i] == 0))
1905  // {
1906  // if (elem->node_id(0) != std::min(elem->node_id(0), elem->node_id(4)))
1907  // zeta_mapped = -zeta;
1908  // }
1909  // // Edge 5
1910  // else if ((i0[i] == 1) && (i1[i] == 0))
1911  // {
1912  // if (elem->node_id(1) != std::min(elem->node_id(1), elem->node_id(5)))
1913  // zeta_mapped = -zeta;
1914  // }
1915  // // Edge 6
1916  // else if ((i0[i] == 1) && (i1[i] == 1))
1917  // {
1918  // if (elem->node_id(2) != std::min(elem->node_id(2), elem->node_id(6)))
1919  // zeta_mapped = -zeta;
1920  // }
1921  // // Edge 7
1922  // else if ((i0[i] == 0) && (i1[i] == 1))
1923  // {
1924  // if (elem->node_id(3) != std::min(elem->node_id(3), elem->node_id(7)))
1925  // zeta_mapped = -zeta;
1926  // }
1927  // // Edge 8
1928  // else if ((i1[i] == 0) && (i2[i] == 1))
1929  // {
1930  // if (elem->node_id(4) != std::min(elem->node_id(4), elem->node_id(5)))
1931  // xi_mapped = -xi;
1932  // }
1933  // // Edge 9
1934  // else if ((i0[i] == 1) && (i2[i] == 1))
1935  // {
1936  // if (elem->node_id(5) != std::min(elem->node_id(5), elem->node_id(6)))
1937  // eta_mapped = -eta;
1938  // }
1939  // // Edge 10
1940  // else if ((i1[i] == 1) && (i2[i] == 1))
1941  // {
1942  // if (elem->node_id(7) != std::min(elem->node_id(7), elem->node_id(6)))
1943  // xi_mapped = -xi;
1944  // }
1945  // // Edge 11
1946  // else if ((i0[i] == 0) && (i2[i] == 1))
1947  // {
1948  // if (elem->node_id(4) != std::min(elem->node_id(4), elem->node_id(7)))
1949  // eta_mapped = -eta;
1950  // }
1951  // }
1952 
1953 
1954  // // handle the face orientation
1955  // {
1956  // // Face 0
1957  // if ( (i2[i] == 0) && (i0[i] >= 2) && (i1[i] >= 2))
1958  // {
1959  // const unsigned int min_node = std::min(elem->node_id(1),
1960  // std::min(elem->node_id(2),
1961  // std::min(elem->node_id(0),
1962  // elem->node_id(3))));
1963  // if (elem->node_id(0) == min_node)
1964  // if (elem->node_id(1) == std::min(elem->node_id(1), elem->node_id(3)))
1965  // {
1966  // // Case 1
1967  // xi_mapped = xi;
1968  // eta_mapped = eta;
1969  // }
1970  // else
1971  // {
1972  // // Case 2
1973  // xi_mapped = eta;
1974  // eta_mapped = xi;
1975  // }
1976 
1977  // else if (elem->node_id(3) == min_node)
1978  // if (elem->node_id(0) == std::min(elem->node_id(0), elem->node_id(2)))
1979  // {
1980  // // Case 3
1981  // xi_mapped = -eta;
1982  // eta_mapped = xi;
1983  // }
1984  // else
1985  // {
1986  // // Case 4
1987  // xi_mapped = xi;
1988  // eta_mapped = -eta;
1989  // }
1990 
1991  // else if (elem->node_id(2) == min_node)
1992  // if (elem->node_id(3) == std::min(elem->node_id(3), elem->node_id(1)))
1993  // {
1994  // // Case 5
1995  // xi_mapped = -xi;
1996  // eta_mapped = -eta;
1997  // }
1998  // else
1999  // {
2000  // // Case 6
2001  // xi_mapped = -eta;
2002  // eta_mapped = -xi;
2003  // }
2004 
2005  // else if (elem->node_id(1) == min_node)
2006  // if (elem->node_id(2) == std::min(elem->node_id(2), elem->node_id(0)))
2007  // {
2008  // // Case 7
2009  // xi_mapped = eta;
2010  // eta_mapped = -xi;
2011  // }
2012  // else
2013  // {
2014  // // Case 8
2015  // xi_mapped = -xi;
2016  // eta_mapped = eta;
2017  // }
2018  // }
2019 
2020 
2021  // // Face 1
2022  // else if ((i1[i] == 0) && (i0[i] >= 2) && (i2[i] >= 2))
2023  // {
2024  // const unsigned int min_node = std::min(elem->node_id(0),
2025  // std::min(elem->node_id(1),
2026  // std::min(elem->node_id(5),
2027  // elem->node_id(4))));
2028  // if (elem->node_id(0) == min_node)
2029  // if (elem->node_id(1) == std::min(elem->node_id(1), elem->node_id(4)))
2030  // {
2031  // // Case 1
2032  // xi_mapped = xi;
2033  // zeta_mapped = zeta;
2034  // }
2035  // else
2036  // {
2037  // // Case 2
2038  // xi_mapped = zeta;
2039  // zeta_mapped = xi;
2040  // }
2041 
2042  // else if (elem->node_id(1) == min_node)
2043  // if (elem->node_id(5) == std::min(elem->node_id(5), elem->node_id(0)))
2044  // {
2045  // // Case 3
2046  // xi_mapped = zeta;
2047  // zeta_mapped = -xi;
2048  // }
2049  // else
2050  // {
2051  // // Case 4
2052  // xi_mapped = -xi;
2053  // zeta_mapped = zeta;
2054  // }
2055 
2056  // else if (elem->node_id(5) == min_node)
2057  // if (elem->node_id(4) == std::min(elem->node_id(4), elem->node_id(1)))
2058  // {
2059  // // Case 5
2060  // xi_mapped = -xi;
2061  // zeta_mapped = -zeta;
2062  // }
2063  // else
2064  // {
2065  // // Case 6
2066  // xi_mapped = -zeta;
2067  // zeta_mapped = -xi;
2068  // }
2069 
2070  // else if (elem->node_id(4) == min_node)
2071  // if (elem->node_id(0) == std::min(elem->node_id(0), elem->node_id(5)))
2072  // {
2073  // // Case 7
2074  // xi_mapped = -xi;
2075  // zeta_mapped = zeta;
2076  // }
2077  // else
2078  // {
2079  // // Case 8
2080  // xi_mapped = xi;
2081  // zeta_mapped = -zeta;
2082  // }
2083  // }
2084 
2085 
2086  // // Face 2
2087  // else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] >= 2))
2088  // {
2089  // const unsigned int min_node = std::min(elem->node_id(1),
2090  // std::min(elem->node_id(2),
2091  // std::min(elem->node_id(6),
2092  // elem->node_id(5))));
2093  // if (elem->node_id(1) == min_node)
2094  // if (elem->node_id(2) == std::min(elem->node_id(2), elem->node_id(5)))
2095  // {
2096  // // Case 1
2097  // eta_mapped = eta;
2098  // zeta_mapped = zeta;
2099  // }
2100  // else
2101  // {
2102  // // Case 2
2103  // eta_mapped = zeta;
2104  // zeta_mapped = eta;
2105  // }
2106 
2107  // else if (elem->node_id(2) == min_node)
2108  // if (elem->node_id(6) == std::min(elem->node_id(6), elem->node_id(1)))
2109  // {
2110  // // Case 3
2111  // eta_mapped = zeta;
2112  // zeta_mapped = -eta;
2113  // }
2114  // else
2115  // {
2116  // // Case 4
2117  // eta_mapped = -eta;
2118  // zeta_mapped = zeta;
2119  // }
2120 
2121  // else if (elem->node_id(6) == min_node)
2122  // if (elem->node_id(5) == std::min(elem->node_id(5), elem->node_id(2)))
2123  // {
2124  // // Case 5
2125  // eta_mapped = -eta;
2126  // zeta_mapped = -zeta;
2127  // }
2128  // else
2129  // {
2130  // // Case 6
2131  // eta_mapped = -zeta;
2132  // zeta_mapped = -eta;
2133  // }
2134 
2135  // else if (elem->node_id(5) == min_node)
2136  // if (elem->node_id(1) == std::min(elem->node_id(1), elem->node_id(6)))
2137  // {
2138  // // Case 7
2139  // eta_mapped = -zeta;
2140  // zeta_mapped = eta;
2141  // }
2142  // else
2143  // {
2144  // // Case 8
2145  // eta_mapped = eta;
2146  // zeta_mapped = -zeta;
2147  // }
2148  // }
2149 
2150 
2151  // // Face 3
2152  // else if ((i1[i] == 1) && (i0[i] >= 2) && (i2[i] >= 2))
2153  // {
2154  // const unsigned int min_node = std::min(elem->node_id(2),
2155  // std::min(elem->node_id(3),
2156  // std::min(elem->node_id(7),
2157  // elem->node_id(6))));
2158  // if (elem->node_id(3) == min_node)
2159  // if (elem->node_id(2) == std::min(elem->node_id(2), elem->node_id(7)))
2160  // {
2161  // // Case 1
2162  // xi_mapped = xi;
2163  // zeta_mapped = zeta;
2164  // }
2165  // else
2166  // {
2167  // // Case 2
2168  // xi_mapped = zeta;
2169  // zeta_mapped = xi;
2170  // }
2171 
2172  // else if (elem->node_id(7) == min_node)
2173  // if (elem->node_id(3) == std::min(elem->node_id(3), elem->node_id(6)))
2174  // {
2175  // // Case 3
2176  // xi_mapped = -zeta;
2177  // zeta_mapped = xi;
2178  // }
2179  // else
2180  // {
2181  // // Case 4
2182  // xi_mapped = xi;
2183  // zeta_mapped = -zeta;
2184  // }
2185 
2186  // else if (elem->node_id(6) == min_node)
2187  // if (elem->node_id(7) == std::min(elem->node_id(7), elem->node_id(2)))
2188  // {
2189  // // Case 5
2190  // xi_mapped = -xi;
2191  // zeta_mapped = -zeta;
2192  // }
2193  // else
2194  // {
2195  // // Case 6
2196  // xi_mapped = -zeta;
2197  // zeta_mapped = -xi;
2198  // }
2199 
2200  // else if (elem->node_id(2) == min_node)
2201  // if (elem->node_id(6) == std::min(elem->node_id(3), elem->node_id(6)))
2202  // {
2203  // // Case 7
2204  // xi_mapped = zeta;
2205  // zeta_mapped = -xi;
2206  // }
2207  // else
2208  // {
2209  // // Case 8
2210  // xi_mapped = -xi;
2211  // zeta_mapped = zeta;
2212  // }
2213  // }
2214 
2215 
2216  // // Face 4
2217  // else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] >= 2))
2218  // {
2219  // const unsigned int min_node = std::min(elem->node_id(3),
2220  // std::min(elem->node_id(0),
2221  // std::min(elem->node_id(4),
2222  // elem->node_id(7))));
2223  // if (elem->node_id(0) == min_node)
2224  // if (elem->node_id(3) == std::min(elem->node_id(3), elem->node_id(4)))
2225  // {
2226  // // Case 1
2227  // eta_mapped = eta;
2228  // zeta_mapped = zeta;
2229  // }
2230  // else
2231  // {
2232  // // Case 2
2233  // eta_mapped = zeta;
2234  // zeta_mapped = eta;
2235  // }
2236 
2237  // else if (elem->node_id(4) == min_node)
2238  // if (elem->node_id(0) == std::min(elem->node_id(0), elem->node_id(7)))
2239  // {
2240  // // Case 3
2241  // eta_mapped = -zeta;
2242  // zeta_mapped = eta;
2243  // }
2244  // else
2245  // {
2246  // // Case 4
2247  // eta_mapped = eta;
2248  // zeta_mapped = -zeta;
2249  // }
2250 
2251  // else if (elem->node_id(7) == min_node)
2252  // if (elem->node_id(4) == std::min(elem->node_id(4), elem->node_id(3)))
2253  // {
2254  // // Case 5
2255  // eta_mapped = -eta;
2256  // zeta_mapped = -zeta;
2257  // }
2258  // else
2259  // {
2260  // // Case 6
2261  // eta_mapped = -zeta;
2262  // zeta_mapped = -eta;
2263  // }
2264 
2265  // else if (elem->node_id(3) == min_node)
2266  // if (elem->node_id(7) == std::min(elem->node_id(7), elem->node_id(0)))
2267  // {
2268  // // Case 7
2269  // eta_mapped = zeta;
2270  // zeta_mapped = -eta;
2271  // }
2272  // else
2273  // {
2274  // // Case 8
2275  // eta_mapped = -eta;
2276  // zeta_mapped = zeta;
2277  // }
2278  // }
2279 
2280 
2281  // // Face 5
2282  // else if ((i2[i] == 1) && (i0[i] >= 2) && (i1[i] >= 2))
2283  // {
2284  // const unsigned int min_node = std::min(elem->node_id(4),
2285  // std::min(elem->node_id(5),
2286  // std::min(elem->node_id(6),
2287  // elem->node_id(7))));
2288  // if (elem->node_id(4) == min_node)
2289  // if (elem->node_id(5) == std::min(elem->node_id(5), elem->node_id(7)))
2290  // {
2291  // // Case 1
2292  // xi_mapped = xi;
2293  // eta_mapped = eta;
2294  // }
2295  // else
2296  // {
2297  // // Case 2
2298  // xi_mapped = eta;
2299  // eta_mapped = xi;
2300  // }
2301 
2302  // else if (elem->node_id(5) == min_node)
2303  // if (elem->node_id(6) == std::min(elem->node_id(6), elem->node_id(4)))
2304  // {
2305  // // Case 3
2306  // xi_mapped = eta;
2307  // eta_mapped = -xi;
2308  // }
2309  // else
2310  // {
2311  // // Case 4
2312  // xi_mapped = -xi;
2313  // eta_mapped = eta;
2314  // }
2315 
2316  // else if (elem->node_id(6) == min_node)
2317  // if (elem->node_id(7) == std::min(elem->node_id(7), elem->node_id(5)))
2318  // {
2319  // // Case 5
2320  // xi_mapped = -xi;
2321  // eta_mapped = -eta;
2322  // }
2323  // else
2324  // {
2325  // // Case 6
2326  // xi_mapped = -eta;
2327  // eta_mapped = -xi;
2328  // }
2329 
2330  // else if (elem->node_id(7) == min_node)
2331  // if (elem->node_id(4) == std::min(elem->node_id(4), elem->node_id(6)))
2332  // {
2333  // // Case 7
2334  // xi_mapped = -eta;
2335  // eta_mapped = xi;
2336  // }
2337  // else
2338  // {
2339  // // Case 8
2340  // xi_mapped = xi;
2341  // eta_mapped = eta;
2342  // }
2343  // }
2344 
2345 
2346  // }
2347 
2348 
2349 
2350  // libmesh_assert_less (j, 3);
2351 
2352  // switch (j)
2353  // {
2354  // // d()/dxi
2355  // case 0:
2356  // return (FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi_mapped)*
2357  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta_mapped)*
2358  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta_mapped));
2359 
2360  // // d()/deta
2361  // case 1:
2362  // return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi_mapped)*
2363  // FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta_mapped)*
2364  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta_mapped));
2365 
2366  // // d()/dzeta
2367  // case 2:
2368  // return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi_mapped)*
2369  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta_mapped)*
2370  // FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[i], 0, zeta_mapped));
2371 
2372  // default:
2373  // libmesh_error_msg("Invalid derivative index j = " << j);
2374  // }
2375  // }
2376 
2377 
2378  default:
2379  libmesh_error_msg("Invalid element type = " << type);
2380  }
2381  }
2382 
2383  // 4th-order Bernstein.
2384  case FOURTH:
2385  {
2386  switch (type)
2387  {
2388 
2389  // Bernstein shape functions derivatives on the hexahedral.
2390  case HEX27:
2391  {
2392  const Real eps = 1.e-6;
2393 
2394  libmesh_assert_less (i, 125);
2395  libmesh_assert_less (j, 3);
2396 
2397  switch (j)
2398  {
2399  // d()/dxi
2400  case 0:
2401  {
2402  const Point pp(p(0)+eps, p(1), p(2));
2403  const Point pm(p(0)-eps, p(1), p(2));
2404 
2405  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
2406  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
2407  }
2408 
2409  // d()/deta
2410  case 1:
2411  {
2412  const Point pp(p(0), p(1)+eps, p(2));
2413  const Point pm(p(0), p(1)-eps, p(2));
2414 
2415  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
2416  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
2417  }
2418  // d()/dzeta
2419  case 2:
2420  {
2421  const Point pp(p(0), p(1), p(2)+eps);
2422  const Point pm(p(0), p(1), p(2)-eps);
2423 
2424  return (FE<3,BERNSTEIN>::shape(elem, order, i, pp) -
2425  FE<3,BERNSTEIN>::shape(elem, order, i, pm))/2./eps;
2426  }
2427  default:
2428  libmesh_error_msg("Invalid derivative index j = " << j);
2429  }
2430  }
2431 
2432  // // Compute hex shape functions as a tensor-product
2433  // const Real xi = p(0);
2434  // const Real eta = p(1);
2435  // const Real zeta = p(2);
2436  // Real xi_mapped = p(0);
2437  // Real eta_mapped = p(1);
2438  // Real zeta_mapped = p(2);
2439 
2440  // // The only way to make any sense of this
2441  // // is to look at the mgflo/mg2/mgf documentation
2442  // // and make the cut-out cube!
2443  // // Nodes 0 1 2 3 4 5 6 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 24 24 25 25 25 25 26 26 26 26 26 26 26 26
2444  // // DOFS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 18 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
2445  // static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4};
2446  // static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 2, 3, 4, 1, 1, 1, 2, 3, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4};
2447  // static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 2, 2, 2, 3, 3, 3, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4};
2448 
2449 
2450 
2451  // // handle the edge orientation
2452  // {
2453  // // Edge 0
2454  // if ((i1[i] == 0) && (i2[i] == 0))
2455  // {
2456  // if (elem->node_id(0) != std::min(elem->node_id(0), elem->node_id(1)))
2457  // xi_mapped = -xi;
2458  // }
2459  // // Edge 1
2460  // else if ((i0[i] == 1) && (i2[i] == 0))
2461  // {
2462  // if (elem->node_id(1) != std::min(elem->node_id(1), elem->node_id(2)))
2463  // eta_mapped = -eta;
2464  // }
2465  // // Edge 2
2466  // else if ((i1[i] == 1) && (i2[i] == 0))
2467  // {
2468  // if (elem->node_id(3) != std::min(elem->node_id(3), elem->node_id(2)))
2469  // xi_mapped = -xi;
2470  // }
2471  // // Edge 3
2472  // else if ((i0[i] == 0) && (i2[i] == 0))
2473  // {
2474  // if (elem->node_id(0) != std::min(elem->node_id(0), elem->node_id(3)))
2475  // eta_mapped = -eta;
2476  // }
2477  // // Edge 4
2478  // else if ((i0[i] == 0) && (i1[i] == 0))
2479  // {
2480  // if (elem->node_id(0) != std::min(elem->node_id(0), elem->node_id(4)))
2481  // zeta_mapped = -zeta;
2482  // }
2483  // // Edge 5
2484  // else if ((i0[i] == 1) && (i1[i] == 0))
2485  // {
2486  // if (elem->node_id(1) != std::min(elem->node_id(1), elem->node_id(5)))
2487  // zeta_mapped = -zeta;
2488  // }
2489  // // Edge 6
2490  // else if ((i0[i] == 1) && (i1[i] == 1))
2491  // {
2492  // if (elem->node_id(2) != std::min(elem->node_id(2), elem->node_id(6)))
2493  // zeta_mapped = -zeta;
2494  // }
2495  // // Edge 7
2496  // else if ((i0[i] == 0) && (i1[i] == 1))
2497  // {
2498  // if (elem->node_id(3) != std::min(elem->node_id(3), elem->node_id(7)))
2499  // zeta_mapped = -zeta;
2500  // }
2501  // // Edge 8
2502  // else if ((i1[i] == 0) && (i2[i] == 1))
2503  // {
2504  // if (elem->node_id(4) != std::min(elem->node_id(4), elem->node_id(5)))
2505  // xi_mapped = -xi;
2506  // }
2507  // // Edge 9
2508  // else if ((i0[i] == 1) && (i2[i] == 1))
2509  // {
2510  // if (elem->node_id(5) != std::min(elem->node_id(5), elem->node_id(6)))
2511  // eta_mapped = -eta;
2512  // }
2513  // // Edge 10
2514  // else if ((i1[i] == 1) && (i2[i] == 1))
2515  // {
2516  // if (elem->node_id(7) != std::min(elem->node_id(7), elem->node_id(6)))
2517  // xi_mapped = -xi;
2518  // }
2519  // // Edge 11
2520  // else if ((i0[i] == 0) && (i2[i] == 1))
2521  // {
2522  // if (elem->node_id(4) != std::min(elem->node_id(4), elem->node_id(7)))
2523  // eta_mapped = -eta;
2524  // }
2525  // }
2526 
2527 
2528  // // handle the face orientation
2529  // {
2530  // // Face 0
2531  // if ( (i2[i] == 0) && (i0[i] >= 2) && (i1[i] >= 2))
2532  // {
2533  // const unsigned int min_node = std::min(elem->node_id(1),
2534  // std::min(elem->node_id(2),
2535  // std::min(elem->node_id(0),
2536  // elem->node_id(3))));
2537  // if (elem->node_id(0) == min_node)
2538  // if (elem->node_id(1) == std::min(elem->node_id(1), elem->node_id(3)))
2539  // {
2540  // // Case 1
2541  // xi_mapped = xi;
2542  // eta_mapped = eta;
2543  // }
2544  // else
2545  // {
2546  // // Case 2
2547  // xi_mapped = eta;
2548  // eta_mapped = xi;
2549  // }
2550 
2551  // else if (elem->node_id(3) == min_node)
2552  // if (elem->node_id(0) == std::min(elem->node_id(0), elem->node_id(2)))
2553  // {
2554  // // Case 3
2555  // xi_mapped = -eta;
2556  // eta_mapped = xi;
2557  // }
2558  // else
2559  // {
2560  // // Case 4
2561  // xi_mapped = xi;
2562  // eta_mapped = -eta;
2563  // }
2564 
2565  // else if (elem->node_id(2) == min_node)
2566  // if (elem->node_id(3) == std::min(elem->node_id(3), elem->node_id(1)))
2567  // {
2568  // // Case 5
2569  // xi_mapped = -xi;
2570  // eta_mapped = -eta;
2571  // }
2572  // else
2573  // {
2574  // // Case 6
2575  // xi_mapped = -eta;
2576  // eta_mapped = -xi;
2577  // }
2578 
2579  // else if (elem->node_id(1) == min_node)
2580  // if (elem->node_id(2) == std::min(elem->node_id(2), elem->node_id(0)))
2581  // {
2582  // // Case 7
2583  // xi_mapped = eta;
2584  // eta_mapped = -xi;
2585  // }
2586  // else
2587  // {
2588  // // Case 8
2589  // xi_mapped = -xi;
2590  // eta_mapped = eta;
2591  // }
2592  // }
2593 
2594 
2595  // // Face 1
2596  // else if ((i1[i] == 0) && (i0[i] >= 2) && (i2[i] >= 2))
2597  // {
2598  // const unsigned int min_node = std::min(elem->node_id(0),
2599  // std::min(elem->node_id(1),
2600  // std::min(elem->node_id(5),
2601  // elem->node_id(4))));
2602  // if (elem->node_id(0) == min_node)
2603  // if (elem->node_id(1) == std::min(elem->node_id(1), elem->node_id(4)))
2604  // {
2605  // // Case 1
2606  // xi_mapped = xi;
2607  // zeta_mapped = zeta;
2608  // }
2609  // else
2610  // {
2611  // // Case 2
2612  // xi_mapped = zeta;
2613  // zeta_mapped = xi;
2614  // }
2615 
2616  // else if (elem->node_id(1) == min_node)
2617  // if (elem->node_id(5) == std::min(elem->node_id(5), elem->node_id(0)))
2618  // {
2619  // // Case 3
2620  // xi_mapped = zeta;
2621  // zeta_mapped = -xi;
2622  // }
2623  // else
2624  // {
2625  // // Case 4
2626  // xi_mapped = -xi;
2627  // zeta_mapped = zeta;
2628  // }
2629 
2630  // else if (elem->node_id(5) == min_node)
2631  // if (elem->node_id(4) == std::min(elem->node_id(4), elem->node_id(1)))
2632  // {
2633  // // Case 5
2634  // xi_mapped = -xi;
2635  // zeta_mapped = -zeta;
2636  // }
2637  // else
2638  // {
2639  // // Case 6
2640  // xi_mapped = -zeta;
2641  // zeta_mapped = -xi;
2642  // }
2643 
2644  // else if (elem->node_id(4) == min_node)
2645  // if (elem->node_id(0) == std::min(elem->node_id(0), elem->node_id(5)))
2646  // {
2647  // // Case 7
2648  // xi_mapped = -xi;
2649  // zeta_mapped = zeta;
2650  // }
2651  // else
2652  // {
2653  // // Case 8
2654  // xi_mapped = xi;
2655  // zeta_mapped = -zeta;
2656  // }
2657  // }
2658 
2659 
2660  // // Face 2
2661  // else if ((i0[i] == 1) && (i1[i] >= 2) && (i2[i] >= 2))
2662  // {
2663  // const unsigned int min_node = std::min(elem->node_id(1),
2664  // std::min(elem->node_id(2),
2665  // std::min(elem->node_id(6),
2666  // elem->node_id(5))));
2667  // if (elem->node_id(1) == min_node)
2668  // if (elem->node_id(2) == std::min(elem->node_id(2), elem->node_id(5)))
2669  // {
2670  // // Case 1
2671  // eta_mapped = eta;
2672  // zeta_mapped = zeta;
2673  // }
2674  // else
2675  // {
2676  // // Case 2
2677  // eta_mapped = zeta;
2678  // zeta_mapped = eta;
2679  // }
2680 
2681  // else if (elem->node_id(2) == min_node)
2682  // if (elem->node_id(6) == std::min(elem->node_id(6), elem->node_id(1)))
2683  // {
2684  // // Case 3
2685  // eta_mapped = zeta;
2686  // zeta_mapped = -eta;
2687  // }
2688  // else
2689  // {
2690  // // Case 4
2691  // eta_mapped = -eta;
2692  // zeta_mapped = zeta;
2693  // }
2694 
2695  // else if (elem->node_id(6) == min_node)
2696  // if (elem->node_id(5) == std::min(elem->node_id(5), elem->node_id(2)))
2697  // {
2698  // // Case 5
2699  // eta_mapped = -eta;
2700  // zeta_mapped = -zeta;
2701  // }
2702  // else
2703  // {
2704  // // Case 6
2705  // eta_mapped = -zeta;
2706  // zeta_mapped = -eta;
2707  // }
2708 
2709  // else if (elem->node_id(5) == min_node)
2710  // if (elem->node_id(1) == std::min(elem->node_id(1), elem->node_id(6)))
2711  // {
2712  // // Case 7
2713  // eta_mapped = -zeta;
2714  // zeta_mapped = eta;
2715  // }
2716  // else
2717  // {
2718  // // Case 8
2719  // eta_mapped = eta;
2720  // zeta_mapped = -zeta;
2721  // }
2722  // }
2723 
2724 
2725  // // Face 3
2726  // else if ((i1[i] == 1) && (i0[i] >= 2) && (i2[i] >= 2))
2727  // {
2728  // const unsigned int min_node = std::min(elem->node_id(2),
2729  // std::min(elem->node_id(3),
2730  // std::min(elem->node_id(7),
2731  // elem->node_id(6))));
2732  // if (elem->node_id(3) == min_node)
2733  // if (elem->node_id(2) == std::min(elem->node_id(2), elem->node_id(7)))
2734  // {
2735  // // Case 1
2736  // xi_mapped = xi;
2737  // zeta_mapped = zeta;
2738  // }
2739  // else
2740  // {
2741  // // Case 2
2742  // xi_mapped = zeta;
2743  // zeta_mapped = xi;
2744  // }
2745 
2746  // else if (elem->node_id(7) == min_node)
2747  // if (elem->node_id(3) == std::min(elem->node_id(3), elem->node_id(6)))
2748  // {
2749  // // Case 3
2750  // xi_mapped = -zeta;
2751  // zeta_mapped = xi;
2752  // }
2753  // else
2754  // {
2755  // // Case 4
2756  // xi_mapped = xi;
2757  // zeta_mapped = -zeta;
2758  // }
2759 
2760  // else if (elem->node_id(6) == min_node)
2761  // if (elem->node_id(7) == std::min(elem->node_id(7), elem->node_id(2)))
2762  // {
2763  // // Case 5
2764  // xi_mapped = -xi;
2765  // zeta_mapped = -zeta;
2766  // }
2767  // else
2768  // {
2769  // // Case 6
2770  // xi_mapped = -zeta;
2771  // zeta_mapped = -xi;
2772  // }
2773 
2774  // else if (elem->node_id(2) == min_node)
2775  // if (elem->node_id(6) == std::min(elem->node_id(3), elem->node_id(6)))
2776  // {
2777  // // Case 7
2778  // xi_mapped = zeta;
2779  // zeta_mapped = -xi;
2780  // }
2781  // else
2782  // {
2783  // // Case 8
2784  // xi_mapped = -xi;
2785  // zeta_mapped = zeta;
2786  // }
2787  // }
2788 
2789 
2790  // // Face 4
2791  // else if ((i0[i] == 0) && (i1[i] >= 2) && (i2[i] >= 2))
2792  // {
2793  // const unsigned int min_node = std::min(elem->node_id(3),
2794  // std::min(elem->node_id(0),
2795  // std::min(elem->node_id(4),
2796  // elem->node_id(7))));
2797  // if (elem->node_id(0) == min_node)
2798  // if (elem->node_id(3) == std::min(elem->node_id(3), elem->node_id(4)))
2799  // {
2800  // // Case 1
2801  // eta_mapped = eta;
2802  // zeta_mapped = zeta;
2803  // }
2804  // else
2805  // {
2806  // // Case 2
2807  // eta_mapped = zeta;
2808  // zeta_mapped = eta;
2809  // }
2810 
2811  // else if (elem->node_id(4) == min_node)
2812  // if (elem->node_id(0) == std::min(elem->node_id(0), elem->node_id(7)))
2813  // {
2814  // // Case 3
2815  // eta_mapped = -zeta;
2816  // zeta_mapped = eta;
2817  // }
2818  // else
2819  // {
2820  // // Case 4
2821  // eta_mapped = eta;
2822  // zeta_mapped = -zeta;
2823  // }
2824 
2825  // else if (elem->node_id(7) == min_node)
2826  // if (elem->node_id(4) == std::min(elem->node_id(4), elem->node_id(3)))
2827  // {
2828  // // Case 5
2829  // eta_mapped = -eta;
2830  // zeta_mapped = -zeta;
2831  // }
2832  // else
2833  // {
2834  // // Case 6
2835  // eta_mapped = -zeta;
2836  // zeta_mapped = -eta;
2837  // }
2838 
2839  // else if (elem->node_id(3) == min_node)
2840  // if (elem->node_id(7) == std::min(elem->node_id(7), elem->node_id(0)))
2841  // {
2842  // // Case 7
2843  // eta_mapped = zeta;
2844  // zeta_mapped = -eta;
2845  // }
2846  // else
2847  // {
2848  // // Case 8
2849  // eta_mapped = -eta;
2850  // zeta_mapped = zeta;
2851  // }
2852  // }
2853 
2854 
2855  // // Face 5
2856  // else if ((i2[i] == 1) && (i0[i] >= 2) && (i1[i] >= 2))
2857  // {
2858  // const unsigned int min_node = std::min(elem->node_id(4),
2859  // std::min(elem->node_id(5),
2860  // std::min(elem->node_id(6),
2861  // elem->node_id(7))));
2862  // if (elem->node_id(4) == min_node)
2863  // if (elem->node_id(5) == std::min(elem->node_id(5), elem->node_id(7)))
2864  // {
2865  // // Case 1
2866  // xi_mapped = xi;
2867  // eta_mapped = eta;
2868  // }
2869  // else
2870  // {
2871  // // Case 2
2872  // xi_mapped = eta;
2873  // eta_mapped = xi;
2874  // }
2875 
2876  // else if (elem->node_id(5) == min_node)
2877  // if (elem->node_id(6) == std::min(elem->node_id(6), elem->node_id(4)))
2878  // {
2879  // // Case 3
2880  // xi_mapped = eta;
2881  // eta_mapped = -xi;
2882  // }
2883  // else
2884  // {
2885  // // Case 4
2886  // xi_mapped = -xi;
2887  // eta_mapped = eta;
2888  // }
2889 
2890  // else if (elem->node_id(6) == min_node)
2891  // if (elem->node_id(7) == std::min(elem->node_id(7), elem->node_id(5)))
2892  // {
2893  // // Case 5
2894  // xi_mapped = -xi;
2895  // eta_mapped = -eta;
2896  // }
2897  // else
2898  // {
2899  // // Case 6
2900  // xi_mapped = -eta;
2901  // eta_mapped = -xi;
2902  // }
2903 
2904  // else if (elem->node_id(7) == min_node)
2905  // if (elem->node_id(4) == std::min(elem->node_id(4), elem->node_id(6)))
2906  // {
2907  // // Case 7
2908  // xi_mapped = -eta;
2909  // eta_mapped = xi;
2910  // }
2911  // else
2912  // {
2913  // // Case 8
2914  // xi_mapped = xi;
2915  // eta_mapped = eta;
2916  // }
2917  // }
2918 
2919 
2920  // }
2921 
2922 
2923 
2924  // libmesh_assert_less (j, 3);
2925 
2926  // switch (j)
2927  // {
2928  // // d()/dxi
2929  // case 0:
2930  // return (FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i0[i], 0, xi_mapped)*
2931  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta_mapped)*
2932  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta_mapped));
2933 
2934  // // d()/deta
2935  // case 1:
2936  // return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi_mapped)*
2937  // FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i1[i], 0, eta_mapped)*
2938  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i2[i], zeta_mapped));
2939 
2940  // // d()/dzeta
2941  // case 2:
2942  // return (FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i0[i], xi_mapped)*
2943  // FE<1,BERNSTEIN>::shape (EDGE3, totalorder, i1[i], eta_mapped)*
2944  // FE<1,BERNSTEIN>::shape_deriv(EDGE3, totalorder, i2[i], 0, zeta_mapped));
2945 
2946  // default:
2947  // libmesh_error_msg("Invalid derivative index j = " << j);
2948  // }
2949  // }
2950 
2951 
2952  default:
2953  libmesh_error_msg("Invalid element type = " << type);
2954  }
2955  }
2956 
2957 
2958  default:
2959  libmesh_error_msg("Invalid totalorder = " << totalorder);
2960  }
2961 
2962 #endif
2963 
2964  libmesh_error_msg("We'll never get here!");
2965  return 0.;
2966 }
libmesh_assert(remote_elem)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, LAGRANGE >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 1916 of file fe_lagrange_shape_3D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::Elem::type().

1921 {
1922  libmesh_assert(elem);
1923 
1924  // call the orientation-independent shape function derivatives
1925  return FE<3,LAGRANGE>::shape_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
1926 }
libmesh_assert(remote_elem)
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 2, CLOUGH >::shape_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 1998 of file fe_clough_shape_2D.C.

2003 {
2004  libmesh_error_msg("Clough-Tocher elements require the real element \nto construct gradient-based degrees of freedom.");
2005  return 0.;
2006 }
template<>
Real libMesh::FE< 2, CLOUGH >::shape_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 2011 of file fe_clough_shape_2D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::SECOND, libMesh::THIRD, libMesh::TRI6, and libMesh::Elem::type().

2016 {
2017  libmesh_assert(elem);
2018 
2019  clough_compute_coefs(elem);
2020 
2021  const ElemType type = elem->type();
2022 
2023  const Order totalorder = static_cast<Order>(order + elem->p_level());
2024 
2025  switch (totalorder)
2026  {
2027  // 2nd-order restricted Clough-Tocher element
2028  case SECOND:
2029  {
2030  // There may be a bug in the 2nd order case; the 3rd order
2031  // Clough-Tocher elements are pretty uniformly better anyways
2032  // so use those instead.
2033  libmesh_experimental();
2034  switch (type)
2035  {
2036  // C1 functions on the Clough-Tocher triangle.
2037  case TRI6:
2038  {
2039  libmesh_assert_less (i, 9);
2040  // FIXME: it would be nice to calculate (and cache)
2041  // clough_raw_shape(j,p) only once per triangle, not 1-7
2042  // times
2043  switch (i)
2044  {
2045  // Note: these DoF numbers are "scrambled" because my
2046  // initial numbering conventions didn't match libMesh
2047  case 0:
2048  return clough_raw_shape_deriv(0, j, p)
2049  + d1d2n * clough_raw_shape_deriv(10, j, p)
2050  + d1d3n * clough_raw_shape_deriv(11, j, p);
2051  case 3:
2052  return clough_raw_shape_deriv(1, j, p)
2053  + d2d3n * clough_raw_shape_deriv(11, j, p)
2054  + d2d1n * clough_raw_shape_deriv(9, j, p);
2055  case 6:
2056  return clough_raw_shape_deriv(2, j, p)
2057  + d3d1n * clough_raw_shape_deriv(9, j, p)
2058  + d3d2n * clough_raw_shape_deriv(10, j, p);
2059  case 1:
2060  return d1xd1x * clough_raw_shape_deriv(3, j, p)
2061  + d1xd1y * clough_raw_shape_deriv(4, j, p)
2062  + d1xd2n * clough_raw_shape_deriv(10, j, p)
2063  + d1xd3n * clough_raw_shape_deriv(11, j, p)
2064  + 0.5 * N01x * d3nd3n * clough_raw_shape_deriv(11, j, p)
2065  + 0.5 * N02x * d2nd2n * clough_raw_shape_deriv(10, j, p);
2066  case 2:
2067  return d1yd1y * clough_raw_shape_deriv(4, j, p)
2068  + d1yd1x * clough_raw_shape_deriv(3, j, p)
2069  + d1yd2n * clough_raw_shape_deriv(10, j, p)
2070  + d1yd3n * clough_raw_shape_deriv(11, j, p)
2071  + 0.5 * N01y * d3nd3n * clough_raw_shape_deriv(11, j, p)
2072  + 0.5 * N02y * d2nd2n * clough_raw_shape_deriv(10, j, p);
2073  case 4:
2074  return d2xd2x * clough_raw_shape_deriv(5, j, p)
2075  + d2xd2y * clough_raw_shape_deriv(6, j, p)
2076  + d2xd3n * clough_raw_shape_deriv(11, j, p)
2077  + d2xd1n * clough_raw_shape_deriv(9, j, p)
2078  + 0.5 * N10x * d3nd3n * clough_raw_shape_deriv(11, j, p)
2079  + 0.5 * N12x * d1nd1n * clough_raw_shape_deriv(9, j, p);
2080  case 5:
2081  return d2yd2y * clough_raw_shape_deriv(6, j, p)
2082  + d2yd2x * clough_raw_shape_deriv(5, j, p)
2083  + d2yd3n * clough_raw_shape_deriv(11, j, p)
2084  + d2yd1n * clough_raw_shape_deriv(9, j, p)
2085  + 0.5 * N10y * d3nd3n * clough_raw_shape_deriv(11, j, p)
2086  + 0.5 * N12y * d1nd1n * clough_raw_shape_deriv(9, j, p);
2087  case 7:
2088  return d3xd3x * clough_raw_shape_deriv(7, j, p)
2089  + d3xd3y * clough_raw_shape_deriv(8, j, p)
2090  + d3xd1n * clough_raw_shape_deriv(9, j, p)
2091  + d3xd2n * clough_raw_shape_deriv(10, j, p)
2092  + 0.5 * N20x * d2nd2n * clough_raw_shape_deriv(10, j, p)
2093  + 0.5 * N21x * d1nd1n * clough_raw_shape_deriv(9, j, p);
2094  case 8:
2095  return d3yd3y * clough_raw_shape_deriv(8, j, p)
2096  + d3yd3x * clough_raw_shape_deriv(7, j, p)
2097  + d3yd1n * clough_raw_shape_deriv(9, j, p)
2098  + d3yd2n * clough_raw_shape_deriv(10, j, p)
2099  + 0.5 * N20y * d2nd2n * clough_raw_shape_deriv(10, j, p)
2100  + 0.5 * N21y * d1nd1n * clough_raw_shape_deriv(9, j, p);
2101  default:
2102  libmesh_error_msg("Invalid shape function index i = " << i);
2103  }
2104  }
2105  default:
2106  libmesh_error_msg("ERROR: Unsupported element type = " << type);
2107  }
2108  }
2109  // 3rd-order Clough-Tocher element
2110  case THIRD:
2111  {
2112  switch (type)
2113  {
2114  // C1 functions on the Clough-Tocher triangle.
2115  case TRI6:
2116  {
2117  libmesh_assert_less (i, 12);
2118 
2119  // FIXME: it would be nice to calculate (and cache)
2120  // clough_raw_shape(j,p) only once per triangle, not 1-7
2121  // times
2122  switch (i)
2123  {
2124  // Note: these DoF numbers are "scrambled" because my
2125  // initial numbering conventions didn't match libMesh
2126  case 0:
2127  return clough_raw_shape_deriv(0, j, p)
2128  + d1d2n * clough_raw_shape_deriv(10, j, p)
2129  + d1d3n * clough_raw_shape_deriv(11, j, p);
2130  case 3:
2131  return clough_raw_shape_deriv(1, j, p)
2132  + d2d3n * clough_raw_shape_deriv(11, j, p)
2133  + d2d1n * clough_raw_shape_deriv(9, j, p);
2134  case 6:
2135  return clough_raw_shape_deriv(2, j, p)
2136  + d3d1n * clough_raw_shape_deriv(9, j, p)
2137  + d3d2n * clough_raw_shape_deriv(10, j, p);
2138  case 1:
2139  return d1xd1x * clough_raw_shape_deriv(3, j, p)
2140  + d1xd1y * clough_raw_shape_deriv(4, j, p)
2141  + d1xd2n * clough_raw_shape_deriv(10, j, p)
2142  + d1xd3n * clough_raw_shape_deriv(11, j, p);
2143  case 2:
2144  return d1yd1y * clough_raw_shape_deriv(4, j, p)
2145  + d1yd1x * clough_raw_shape_deriv(3, j, p)
2146  + d1yd2n * clough_raw_shape_deriv(10, j, p)
2147  + d1yd3n * clough_raw_shape_deriv(11, j, p);
2148  case 4:
2149  return d2xd2x * clough_raw_shape_deriv(5, j, p)
2150  + d2xd2y * clough_raw_shape_deriv(6, j, p)
2151  + d2xd3n * clough_raw_shape_deriv(11, j, p)
2152  + d2xd1n * clough_raw_shape_deriv(9, j, p);
2153  case 5:
2154  return d2yd2y * clough_raw_shape_deriv(6, j, p)
2155  + d2yd2x * clough_raw_shape_deriv(5, j, p)
2156  + d2yd3n * clough_raw_shape_deriv(11, j, p)
2157  + d2yd1n * clough_raw_shape_deriv(9, j, p);
2158  case 7:
2159  return d3xd3x * clough_raw_shape_deriv(7, j, p)
2160  + d3xd3y * clough_raw_shape_deriv(8, j, p)
2161  + d3xd1n * clough_raw_shape_deriv(9, j, p)
2162  + d3xd2n * clough_raw_shape_deriv(10, j, p);
2163  case 8:
2164  return d3yd3y * clough_raw_shape_deriv(8, j, p)
2165  + d3yd3x * clough_raw_shape_deriv(7, j, p)
2166  + d3yd1n * clough_raw_shape_deriv(9, j, p)
2167  + d3yd2n * clough_raw_shape_deriv(10, j, p);
2168  case 10:
2169  return d1nd1n * clough_raw_shape_deriv(9, j, p);
2170  case 11:
2171  return d2nd2n * clough_raw_shape_deriv(10, j, p);
2172  case 9:
2173  return d3nd3n * clough_raw_shape_deriv(11, j, p);
2174 
2175  default:
2176  libmesh_error_msg("Invalid shape function index i = " << i);
2177  }
2178  }
2179  default:
2180  libmesh_error_msg("ERROR: Unsupported element type = " << type);
2181  }
2182  }
2183  // by default throw an error
2184  default:
2185  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
2186  }
2187 
2188  libmesh_error_msg("We'll never get here!");
2189  return 0.;
2190 }
libmesh_assert(remote_elem)
unsigned int p_level() const
Definition: elem.h:2141
virtual ElemType type() const =0
template<>
Real libMesh::FE< 1, SCALAR >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 67 of file fe_scalar_shape_1D.C.

72 {
73  return 0.;
74 }
template<>
Real libMesh::FE< 3, SCALAR >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 67 of file fe_scalar_shape_3D.C.

72 {
73  return 0.;
74 }
template<>
Real libMesh::FE< 0, SCALAR >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 67 of file fe_scalar_shape_0D.C.

72 {
73  return 0.;
74 }
template<>
Real libMesh::FE< 2, SCALAR >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 69 of file fe_scalar_shape_2D.C.

74 {
75  return 0.;
76 }
template<>
Real libMesh::FE< 3, SCALAR >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 77 of file fe_scalar_shape_3D.C.

82 {
83  return 0.;
84 }
template<>
Real libMesh::FE< 1, SCALAR >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 77 of file fe_scalar_shape_1D.C.

82 {
83  return 0.;
84 }
template<>
Real libMesh::FE< 0, SCALAR >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 77 of file fe_scalar_shape_0D.C.

82 {
83  return 0.;
84 }
template<>
Real libMesh::FE< 2, SCALAR >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 79 of file fe_scalar_shape_2D.C.

84 {
85  return 0.;
86 }
template<>
Real libMesh::FE< 3, SZABAB >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 81 of file fe_szabab_shape_3D.C.

86 {
87  libmesh_error_msg("Szabo-Babuska polynomials are not defined in 3D");
88  return 0.;
89 }
template<>
Real libMesh::FE< 0, LAGRANGE >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 83 of file fe_lagrange_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }
template<>
Real libMesh::FE< 0, SZABAB >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 83 of file fe_szabab_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }
template<>
Real libMesh::FE< 0, L2_HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 83 of file fe_l2_hierarchic_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }
template<>
Real libMesh::FE< 0, L2_LAGRANGE >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 83 of file fe_l2_lagrange_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }
template<>
Real libMesh::FE< 0, XYZ >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 83 of file fe_xyz_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }
template<>
Real libMesh::FE< 0, CLOUGH >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 83 of file fe_clough_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }
template<>
Real libMesh::FE< 0, HERMITE >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 83 of file fe_hermite_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }
template<>
Real libMesh::FE< 0, HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 83 of file fe_hierarchic_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }
template<>
Real libMesh::FE< 0, MONOMIAL >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 83 of file fe_monomial_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }
template<>
Real libMesh::FE< 0, BERNSTEIN >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 83 of file fe_bernstein_shape_0D.C.

88 {
89  libmesh_error_msg("No spatial derivatives in 0D!");
90  return 0.;
91 }
template<>
Real libMesh::FE< 3, CLOUGH >::shape_second_deriv ( const Elem libmesh_dbg_varelem,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 86 of file fe_clough_shape_3D.C.

References libMesh::libmesh_assert().

91 {
92  libmesh_assert(elem);
93  libmesh_not_implemented();
94  return 0.;
95 }
libmesh_assert(remote_elem)
template<>
Real libMesh::FE< 3, SZABAB >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 94 of file fe_szabab_shape_3D.C.

99 {
100  libmesh_error_msg("Szabo-Babuska polynomials are not defined in 3D");
101  return 0.;
102 }
template<>
Real libMesh::FE< 0, MONOMIAL >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 96 of file fe_monomial_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }
template<>
Real libMesh::FE< 0, CLOUGH >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 96 of file fe_clough_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }
template<>
Real libMesh::FE< 0, L2_LAGRANGE >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 96 of file fe_l2_lagrange_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }
template<>
Real libMesh::FE< 0, L2_HIERARCHIC >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 96 of file fe_l2_hierarchic_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }
template<>
Real libMesh::FE< 0, BERNSTEIN >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 96 of file fe_bernstein_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }
template<>
Real libMesh::FE< 0, LAGRANGE >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 96 of file fe_lagrange_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }
template<>
Real libMesh::FE< 0, XYZ >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 96 of file fe_xyz_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }
template<>
Real libMesh::FE< 0, HIERARCHIC >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 96 of file fe_hierarchic_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }
template<>
Real libMesh::FE< 0, HERMITE >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 96 of file fe_hermite_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }
template<>
Real libMesh::FE< 0, SZABAB >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 96 of file fe_szabab_shape_0D.C.

101 {
102  libmesh_error_msg("No spatial derivatives in 0D!");
103  return 0.;
104 }
template<>
Real libMesh::FE< 1, MONOMIAL >::shape_second_deriv ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int   libmesh_dbg_varj,
const Point p 
)

Definition at line 147 of file fe_monomial_shape_1D.C.

References libMesh::Real.

152 {
153  // only d()/dxi in 1D!
154 
155  libmesh_assert_equal_to (j, 0);
156 
157  const Real xi = p(0);
158 
159  libmesh_assert_less_equal (i, static_cast<unsigned int>(order));
160 
161  switch (i)
162  {
163  case 0:
164  case 1:
165  return 0.;
166 
167  case 2:
168  return 2.;
169 
170  case 3:
171  return 6.*xi;
172 
173  case 4:
174  return 12.*xi*xi;
175 
176  default:
177  Real val = 2.;
178  for (unsigned int index = 2; index != i; ++index)
179  val *= (index+1) * xi;
180  return val;
181  }
182 
183  libmesh_error_msg("We'll never get here!");
184  return 0.;
185 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, SZABAB >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 159 of file fe_szabab_shape_1D.C.

References libMesh::err.

164 {
165  static bool warning_given = false;
166 
167  if (!warning_given)
168  libMesh::err << "Second derivatives for Szabab elements "
169  << " are not yet implemented!"
170  << std::endl;
171 
172  warning_given = true;
173  return 0.;
174 }
OStreamProxy err(std::cerr)
template<>
Real libMesh::FE< 1, XYZ >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 167 of file fe_xyz_shape_1D.C.

172 {
173  libmesh_error_msg("XYZ polynomials require the element \nbecause the centroid is needed.");
174  return 0.;
175 }
template<unsigned int Dim, FEFamily T>
static OutputShape libMesh::FE< Dim, T >::shape_second_deriv ( const ElemType  t,
const Order  o,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
static
Returns
the second $ j^{th} $ derivative of the $ i^{th} $ shape function at the point p. Note that cross-derivatives are also possible, i.e. j = 0 ==> d^2 phi / dxi^2 j = 1 ==> d^2 phi / dxi deta j = 2 ==> d^2 phi / deta^2 j = 3 ==> d^2 phi / dxi dzeta j = 4 ==> d^2 phi / deta dzeta j = 5 ==> d^2 phi / dzeta^2

Note: Computing second derivatives is not currently supported for all element types: C1 (Clough, Hermite and Subdivision), Lagrange, Hierarchic, L2_Hierarchic, and Monomial are supported. All other element types return an error when asked for second derivatives.

On a p-refined element, o should be the total order of the element.

Referenced by libMesh::FEXYZ< Dim >::compute_shape_functions(), libMesh::FEMap::init_edge_shape_functions(), libMesh::FEMap::init_face_shape_functions(), libMesh::FEMap::init_reference_to_physical_map(), libMesh::FE< Dim, T >::init_shape_functions(), libMesh::FESubdivision::init_shape_functions(), and libMesh::FE< Dim, T >::shape_second_deriv().

template<>
Real libMesh::FE< 1, SZABAB >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 179 of file fe_szabab_shape_1D.C.

References libMesh::err.

184 {
185  static bool warning_given = false;
186 
187  if (!warning_given)
188  libMesh::err << "Second derivatives for Szabab elements "
189  << " are not yet implemented!"
190  << std::endl;
191 
192  warning_given = true;
193  return 0.;
194 }
OStreamProxy err(std::cerr)
template<>
Real libMesh::FE< 1, XYZ >::shape_second_deriv ( const Elem elem,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int   libmesh_dbg_varj,
const Point point_in 
)

Definition at line 180 of file fe_xyz_shape_1D.C.

References std::abs(), libMesh::Elem::centroid(), libMesh::libmesh_assert(), std::max(), libMesh::Elem::n_nodes(), libMesh::Elem::p_level(), libMesh::Elem::point(), std::pow(), libMesh::Real, and libMesh::x.

185 {
186  libmesh_assert(elem);
187  libmesh_assert_less_equal (i, order + elem->p_level());
188 
189  // only d2()/dxi2 in 1D!
190 
191  libmesh_assert_equal_to (j, 0);
192 
193  Point centroid = elem->centroid();
194  Real max_distance = 0.;
195  for (unsigned int p = 0; p < elem->n_nodes(); p++)
196  {
197  const Real distance = std::abs(centroid(0) - elem->point(p)(0));
198  max_distance = std::max(distance, max_distance);
199  }
200 
201  const Real x = point_in(0);
202  const Real xc = centroid(0);
203  const Real dx = (x - xc)/max_distance;
204  const Real dist2 = pow(max_distance,2.);
205 
206  // monomials. since they are hierarchic we only need one case block.
207  switch (i)
208  {
209  case 0:
210  case 1:
211  return 0.;
212 
213  case 2:
214  return 2./dist2;
215 
216  case 3:
217  return 6.*dx/dist2;
218 
219  case 4:
220  return 12.*dx*dx/dist2;
221 
222  default:
223  Real val = 2.;
224  for (unsigned int index = 2; index != i; ++index)
225  val *= (index+1) * dx;
226  return val/dist2;
227  }
228 
229  libmesh_error_msg("We'll never get here!");
230  return 0.;
231 }
double abs(double a)
libmesh_assert(remote_elem)
long double max(long double a, double b)
PetscErrorCode Vec x
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, MONOMIAL >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 190 of file fe_monomial_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

195 {
196  libmesh_assert(elem);
197 
198  return FE<1,MONOMIAL>::shape_second_deriv(elem->type(),
199  static_cast<Order>(order + elem->p_level()), i, j, p);
200 }
libmesh_assert(remote_elem)
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<unsigned int Dim, FEFamily T>
static OutputShape libMesh::FE< Dim, T >::shape_second_deriv ( const Elem elem,
const Order  o,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
static
Returns
the second $ j^{th} $ derivative of the $ i^{th} $ shape function at the point p. Note that cross-derivatives are also possible, i.e. j = 0 ==> d^2 phi / dxi^2 j = 1 ==> d^2 phi / dxi deta j = 2 ==> d^2 phi / deta^2 j = 3 ==> d^2 phi / dxi dzeta j = 4 ==> d^2 phi / deta dzeta j = 5 ==> d^2 phi / dzeta^2

Note: Computing second derivatives is not currently supported for all element types: C1 (Clough, Hermite and Subdivision), Lagrange, Hierarchic, L2_Hierarchic, and Monomial are supported. All other element types return an error when asked for second derivatives.

On a p-refined element, o should be the base order of the element.

template<>
Real libMesh::FE< 1, L2_HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int   libmesh_dbg_varj,
const Point p 
)

Definition at line 200 of file fe_l2_hierarchic_shape_1D.C.

References libMesh::Utility::pow(), and libMesh::Real.

205 {
206  // only d2()/d2xi in 1D!
207 
208  libmesh_assert_equal_to (j, 0);
209  libmesh_assert_less (i, order+1u);
210 
211  // Declare that we are using our own special power function
212  // from the Utility namespace. This saves typing later.
213  using Utility::pow;
214 
215  const Real xi = p(0);
216 
217  Real returnval = 1.;
218 
219  switch (i)
220  {
221  case 0:
222  case 1:
223  returnval = 0;
224  break;
225  // All terms have the same form.
226  // xi^(p-2)/(p-2)!
227  case 2:
228  returnval = 1;
229  break;
230  case 3:
231  returnval = xi;
232  break;
233  case 4:
234  returnval = pow<2>(xi)/2.;
235  break;
236  case 5:
237  returnval = pow<3>(xi)/6.;
238  break;
239  case 6:
240  returnval = pow<4>(xi)/24.;
241  break;
242  case 7:
243  returnval = pow<5>(xi)/120.;
244  break;
245 
246  default:
247  Real denominator = 1.;
248  for (unsigned int n=1; n != i; ++n)
249  {
250  returnval *= xi;
251  denominator *= n;
252  }
253  // Odd:
254  if (i % 2)
255  returnval = (i * returnval - 1.)/denominator/i;
256  // Even:
257  else
258  returnval = returnval/denominator;
259  break;
260  }
261 
262  return returnval;
263 }
T pow(const T &x)
Definition: utility.h:194
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int   libmesh_dbg_varj,
const Point p 
)

Definition at line 200 of file fe_hierarchic_shape_1D.C.

References libMesh::Utility::pow(), and libMesh::Real.

205 {
206  // only d2()/d2xi in 1D!
207 
208  libmesh_assert_equal_to (j, 0);
209  libmesh_assert_less (i, order+1u);
210 
211  // Declare that we are using our own special power function
212  // from the Utility namespace. This saves typing later.
213  using Utility::pow;
214 
215  const Real xi = p(0);
216 
217  Real returnval = 1.;
218 
219  switch (i)
220  {
221  case 0:
222  case 1:
223  returnval = 0;
224  break;
225  // All terms have the same form.
226  // xi^(p-2)/(p-2)!
227  case 2:
228  returnval = 1;
229  break;
230  case 3:
231  returnval = xi;
232  break;
233  case 4:
234  returnval = pow<2>(xi)/2.;
235  break;
236  case 5:
237  returnval = pow<3>(xi)/6.;
238  break;
239  case 6:
240  returnval = pow<4>(xi)/24.;
241  break;
242  case 7:
243  returnval = pow<5>(xi)/120.;
244  break;
245 
246  default:
247  Real denominator = 1.;
248  for (unsigned int n=1; n != i; ++n)
249  {
250  returnval *= xi;
251  denominator *= n;
252  }
253  // Odd:
254  if (i % 2)
255  returnval = (i * returnval - 1.)/denominator/i;
256  // Even:
257  else
258  returnval = returnval/denominator;
259  break;
260  }
261 
262  return returnval;
263 }
T pow(const T &x)
Definition: utility.h:194
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, LAGRANGE >::shape_second_deriv ( const ElemType  ,
const Order  order,
const unsigned int  i,
const unsigned int   libmesh_dbg_varj,
const Point p 
)

Definition at line 241 of file fe_lagrange_shape_1D.C.

References libMesh::FIRST, libMesh::Real, libMesh::SECOND, and libMesh::THIRD.

246 {
247  // Don't need to switch on j. 1D shape functions
248  // depend on xi only!
249 
250  const Real xi = p(0);
251  libmesh_assert_equal_to (j, 0);
252 
253  switch (order)
254  {
255  // linear Lagrange shape functions
256  case FIRST:
257  {
258  // All second derivatives of linears are zero....
259  return 0.;
260  }
261 
262  // quadratic Lagrange shape functions
263  case SECOND:
264  {
265  switch (i)
266  {
267  case 0:
268  return 1.;
269 
270  case 1:
271  return 1.;
272 
273  case 2:
274  return -2.;
275 
276  default:
277  libmesh_error_msg("Invalid shape function index i = " << i);
278  }
279  } // end case SECOND
280 
281  case THIRD:
282  {
283  switch (i)
284  {
285  case 0:
286  return -9./16.*(6.*xi-2);
287 
288  case 1:
289  return -9./16.*(-6*xi-2.);
290 
291  case 2:
292  return 27./16.*(6*xi-2./3.);
293 
294  case 3:
295  return 27./16.*(-6*xi-2./3.);
296 
297  default:
298  libmesh_error_msg("Invalid shape function index i = " << i);
299  }
300  } // end case THIRD
301 
302 
303  default:
304  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
305  } // end switch (order)
306 
307  libmesh_error_msg("We'll never get here!");
308  return 0.;
309 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, L2_LAGRANGE >::shape_second_deriv ( const ElemType  ,
const Order  order,
const unsigned int  i,
const unsigned int   libmesh_dbg_varj,
const Point p 
)

Definition at line 241 of file fe_l2_lagrange_shape_1D.C.

References libMesh::FIRST, libMesh::Real, libMesh::SECOND, and libMesh::THIRD.

246 {
247  // Don't need to switch on j. 1D shape functions
248  // depend on xi only!
249 
250  const Real xi = p(0);
251  libmesh_assert_equal_to (j, 0);
252 
253  switch (order)
254  {
255  // linear Lagrange shape functions
256  case FIRST:
257  {
258  // All second derivatives of linears are zero....
259  return 0.;
260  }
261 
262  // quadratic Lagrange shape functions
263  case SECOND:
264  {
265  switch (i)
266  {
267  case 0:
268  return 1.;
269 
270  case 1:
271  return 1.;
272 
273  case 2:
274  return -2.;
275 
276  default:
277  libmesh_error_msg("Invalid shape function index i = " << i);
278  }
279  } // end case SECOND
280 
281  case THIRD:
282  {
283  switch (i)
284  {
285  case 0:
286  return -9./16.*(6.*xi-2);
287 
288  case 1:
289  return -9./16.*(-6*xi-2.);
290 
291  case 2:
292  return 27./16.*(6*xi-2./3.);
293 
294  case 3:
295  return 27./16.*(-6*xi-2./3.);
296 
297  default:
298  libmesh_error_msg("Invalid shape function index i = " << i);
299  }
300  } // end case THIRD
301 
302 
303  default:
304  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
305  } // end switch (order)
306 
307  libmesh_error_msg("We'll never get here!");
308  return 0.;
309 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, L2_HIERARCHIC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 268 of file fe_l2_hierarchic_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

273 {
274  libmesh_assert(elem);
275 
276  return FE<1,L2_HIERARCHIC>::shape_second_deriv(elem->type(),
277  static_cast<Order>(order + elem->p_level()), i, j, p);
278 }
libmesh_assert(remote_elem)
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 1, HIERARCHIC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 268 of file fe_hierarchic_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

273 {
274  libmesh_assert(elem);
275 
276  return FE<1,HIERARCHIC>::shape_second_deriv(elem->type(),
277  static_cast<Order>(order + elem->p_level()), i, j, p);
278 }
libmesh_assert(remote_elem)
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 1, L2_LAGRANGE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 314 of file fe_l2_lagrange_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

319 {
320  libmesh_assert(elem);
321 
322  return FE<1,L2_LAGRANGE>::shape_second_deriv(elem->type(),
323  static_cast<Order>(order + elem->p_level()), i, j, p);
324 }
libmesh_assert(remote_elem)
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 1, LAGRANGE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 314 of file fe_lagrange_shape_1D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

319 {
320  libmesh_assert(elem);
321 
322  return FE<1,LAGRANGE>::shape_second_deriv(elem->type(),
323  static_cast<Order>(order + elem->p_level()), i, j, p);
324 }
libmesh_assert(remote_elem)
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 1, HERMITE >::shape_second_deriv ( const Elem elem,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned  int,
const Point p 
)

Definition at line 316 of file fe_hermite_shape_1D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::FEHermite< Dim >::hermite_raw_shape_second_deriv(), libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Real, and libMesh::Elem::type().

321 {
322  libmesh_assert(elem);
323 
324  // Coefficient naming: d(1)d(2n) is the coefficient of the
325  // global shape function corresponding to value 1 in terms of the
326  // local shape function corresponding to normal derivative 2
327  Real d1xd1x, d2xd2x;
328 
329  hermite_compute_coefs(elem, d1xd1x, d2xd2x);
330 
331  const ElemType type = elem->type();
332 
333 #ifndef NDEBUG
334  const unsigned int totalorder = order + elem->p_level();
335 #endif
336 
337  switch (type)
338  {
339  // C1 functions on the C1 cubic edge
340  case EDGE2:
341  case EDGE3:
342  {
343  libmesh_assert_less (i, totalorder+1);
344 
345  switch (i)
346  {
347  case 0:
349  case 1:
350  return d1xd1x * FEHermite<1>::hermite_raw_shape_second_deriv(2, p(0));
351  case 2:
353  case 3:
354  return d2xd2x * FEHermite<1>::hermite_raw_shape_second_deriv(3, p(0));
355  default:
357  }
358  }
359  default:
360  libmesh_error_msg("ERROR: Unsupported element type = " << type);
361  }
362 
363  libmesh_error_msg("We'll never get here!");
364  return 0.;
365 }
libmesh_assert(remote_elem)
unsigned int p_level() const
Definition: elem.h:2141
static Real hermite_raw_shape_second_deriv(const unsigned int basis_num, const Real xi)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ElemType type() const =0
template<>
Real libMesh::FE< 2, MONOMIAL >::shape_second_deriv ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 321 of file fe_monomial_shape_2D.C.

References libMesh::Real.

326 {
327 #if LIBMESH_DIM > 1
328 
329 
330  libmesh_assert_less_equal (j, 2);
331 
332  libmesh_assert_less (i, (static_cast<unsigned int>(order)+1)*
333  (static_cast<unsigned int>(order)+2)/2);
334 
335  const Real xi = p(0);
336  const Real eta = p(1);
337 
338  // monomials. since they are hierarchic we only need one case block.
339 
340  switch (j)
341  {
342  // d^2()/dxi^2
343  case 0:
344  {
345  switch (i)
346  {
347  // constants
348  case 0:
349  // linears
350  case 1:
351  case 2:
352  return 0.;
353 
354  // quadratics
355  case 3:
356  return 2.;
357 
358  case 4:
359  case 5:
360  return 0.;
361 
362  // cubics
363  case 6:
364  return 6.*xi;
365 
366  case 7:
367  return 2.*eta;
368 
369  case 8:
370  case 9:
371  return 0.;
372 
373  // quartics
374  case 10:
375  return 12.*xi*xi;
376 
377  case 11:
378  return 6.*xi*eta;
379 
380  case 12:
381  return 2.*eta*eta;
382 
383  case 13:
384  case 14:
385  return 0.;
386 
387  default:
388  unsigned int o = 0;
389  for (; i >= (o+1)*(o+2)/2; o++) { }
390  unsigned int ny = i - (o*(o+1)/2);
391  unsigned int nx = o - ny;
392  Real val = nx * (nx - 1);
393  for (unsigned int index=2; index < nx; index++)
394  val *= xi;
395  for (unsigned int index=0; index != ny; index++)
396  val *= eta;
397  return val;
398  }
399  }
400 
401  // d^2()/dxideta
402  case 1:
403  {
404  switch (i)
405  {
406  // constants
407  case 0:
408 
409  // linears
410  case 1:
411  case 2:
412  return 0.;
413 
414  // quadratics
415  case 3:
416  return 0.;
417 
418  case 4:
419  return 1.;
420 
421  case 5:
422  return 0.;
423 
424  // cubics
425  case 6:
426  return 0.;
427  case 7:
428  return 2.*xi;
429 
430  case 8:
431  return 2.*eta;
432 
433  case 9:
434  return 0.;
435 
436  // quartics
437  case 10:
438  return 0.;
439 
440  case 11:
441  return 3.*xi*xi;
442 
443  case 12:
444  return 4.*xi*eta;
445 
446  case 13:
447  return 3.*eta*eta;
448 
449  case 14:
450  return 0.;
451 
452  default:
453  unsigned int o = 0;
454  for (; i >= (o+1)*(o+2)/2; o++) { }
455  unsigned int ny = i - (o*(o+1)/2);
456  unsigned int nx = o - ny;
457  Real val = nx * ny;
458  for (unsigned int index=1; index < nx; index++)
459  val *= xi;
460  for (unsigned int index=1; index < ny; index++)
461  val *= eta;
462  return val;
463  }
464  }
465 
466  // d^2()/deta^2
467  case 2:
468  {
469  switch (i)
470  {
471  // constants
472  case 0:
473 
474  // linears
475  case 1:
476  case 2:
477  return 0.;
478 
479  // quadratics
480  case 3:
481  case 4:
482  return 0.;
483 
484  case 5:
485  return 2.;
486 
487  // cubics
488  case 6:
489  return 0.;
490 
491  case 7:
492  return 0.;
493 
494  case 8:
495  return 2.*xi;
496 
497  case 9:
498  return 6.*eta;
499 
500  // quartics
501  case 10:
502  case 11:
503  return 0.;
504 
505  case 12:
506  return 2.*xi*xi;
507 
508  case 13:
509  return 6.*xi*eta;
510 
511  case 14:
512  return 12.*eta*eta;
513 
514  default:
515  unsigned int o = 0;
516  for (; i >= (o+1)*(o+2)/2; o++) { }
517  unsigned int ny = i - (o*(o+1)/2);
518  unsigned int nx = o - ny;
519  Real val = ny * (ny - 1);
520  for (unsigned int index=0; index != nx; index++)
521  val *= xi;
522  for (unsigned int index=2; index < ny; index++)
523  val *= eta;
524  return val;
525  }
526  }
527 
528  default:
529  libmesh_error_msg("Invalid shape function derivative j = " << j);
530  }
531 
532  libmesh_error_msg("We'll never get here!");
533  return 0.;
534 
535 #endif
536 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, HERMITE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 329 of file fe_hermite_shape_2D.C.

References libMesh::FEHermite< Dim >::hermite_raw_shape(), libMesh::FEHermite< Dim >::hermite_raw_shape_deriv(), libMesh::FEHermite< Dim >::hermite_raw_shape_second_deriv(), libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::Real, and libMesh::Elem::type().

334 {
335  libmesh_assert(elem);
336  libmesh_assert (j == 0 || j == 1 || j == 2);
337 
338  std::vector<std::vector<Real> > dxdxi(2, std::vector<Real>(2, 0));
339 
340 #ifdef DEBUG
341  std::vector<Real> dxdeta(2), dydxi(2);
342 #endif
343 
344  hermite_compute_coefs(elem,dxdxi
345 #ifdef DEBUG
346  ,dxdeta,dydxi
347 #endif
348  );
349 
350  const ElemType type = elem->type();
351 
352  const Order totalorder = static_cast<Order>(order + elem->p_level());
353 
354  switch (type)
355  {
356  case QUAD4:
357  case QUADSHELL4:
358  libmesh_assert_less (totalorder, 4);
359  case QUAD8:
360  case QUAD9:
361  {
362  libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
363 
364  std::vector<unsigned int> bases1D;
365 
366  Real coef = hermite_bases_2D(bases1D, dxdxi, totalorder, i);
367 
368  switch (j)
369  {
370  case 0:
371  return coef *
373  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1));
374  case 1:
375  return coef *
376  FEHermite<1>::hermite_raw_shape_deriv(bases1D[0],p(0)) *
377  FEHermite<1>::hermite_raw_shape_deriv(bases1D[1],p(1));
378  case 2:
379  return coef *
380  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
382  default:
383  libmesh_error_msg("Invalid derivative index j = " << j);
384  }
385  }
386  default:
387  libmesh_error_msg("ERROR: Unsupported element type = " << type);
388  }
389 
390  libmesh_error_msg("We'll never get here!");
391  return 0.;
392 }
libmesh_assert(remote_elem)
unsigned int p_level() const
Definition: elem.h:2141
static Real hermite_raw_shape_second_deriv(const unsigned int basis_num, const Real xi)
static Real hermite_raw_shape(const unsigned int basis_num, const Real xi)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static Real hermite_raw_shape_deriv(const unsigned int basis_num, const Real xi)
virtual ElemType type() const =0
template<>
RealGradient libMesh::FE< 2, NEDELEC_ONE >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 332 of file fe_nedelec_one_shape_2D.C.

337 {
338  libmesh_error_msg("Nedelec elements require the element type \nbecause edge orientation is needed.");
339  return RealGradient();
340 }
RealVectorValue RealGradient
template<>
RealGradient libMesh::FE< 2, NEDELEC_ONE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int   libmesh_dbg_vari,
const unsigned int   libmesh_dbg_varj,
const Point  
)

Definition at line 345 of file fe_nedelec_one_shape_2D.C.

References libMesh::FIRST, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::QUAD8, libMesh::QUAD9, libMesh::TRI6, and libMesh::Elem::type().

350 {
351 #if LIBMESH_DIM > 1
352  libmesh_assert(elem);
353 
354  // j = 0 ==> d^2 phi / dxi^2
355  // j = 1 ==> d^2 phi / dxi deta
356  // j = 2 ==> d^2 phi / deta^2
357  libmesh_assert_less (j, 3);
358 
359  const Order total_order = static_cast<Order>(order + elem->p_level());
360 
361  switch (total_order)
362  {
363  // linear Lagrange shape functions
364  case FIRST:
365  {
366  switch (elem->type())
367  {
368  case QUAD8:
369  case QUAD9:
370  {
371  libmesh_assert_less (i, 4);
372  // All second derivatives for linear quads are zero.
373  return RealGradient();
374  }
375 
376  case TRI6:
377  {
378  libmesh_assert_less (i, 3);
379  // All second derivatives for linear triangles are zero.
380  return RealGradient();
381  }
382 
383  default:
384  libmesh_error_msg("ERROR: Unsupported 2D element type!: " << elem->type());
385 
386  } // end switch (type)
387  } // end case FIRST
388 
389  // unsupported order
390  default:
391  libmesh_error_msg("ERROR: Unsupported 2D FE order!: " << total_order);
392 
393  } // end switch (order)
394 
395 #endif // LIBMESH_DIM > 1
396 
397  libmesh_error_msg("We'll never get here!");
398  return RealGradient();
399 }
RealVectorValue RealGradient
libmesh_assert(remote_elem)
template<>
Real libMesh::FE< 1, CLOUGH >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 349 of file fe_clough_shape_1D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::THIRD, and libMesh::Elem::type().

354 {
355  libmesh_assert(elem);
356 
357  clough_compute_coefs(elem);
358 
359  const ElemType type = elem->type();
360 
361  const Order totalorder = static_cast<Order>(order + elem->p_level());
362 
363  switch (totalorder)
364  {
365  // 3rd-order C1 cubic element
366  case THIRD:
367  {
368  switch (type)
369  {
370  // C1 functions on the C1 cubic edge
371  case EDGE2:
372  case EDGE3:
373  {
374  switch (i)
375  {
376  case 0:
377  return clough_raw_shape_second_deriv(0, j, p);
378  case 1:
379  return clough_raw_shape_second_deriv(1, j, p);
380  case 2:
381  return d1xd1x * clough_raw_shape_second_deriv(2, j, p);
382  case 3:
383  return d2xd2x * clough_raw_shape_second_deriv(3, j, p);
384  default:
385  libmesh_error_msg("Invalid shape function index i = " << i);
386  }
387  }
388  default:
389  libmesh_error_msg("ERROR: Unsupported element type = " << type);
390  }
391  }
392  // by default throw an error
393  default:
394  libmesh_error_msg("ERROR: Unsupported polynomial order = " << totalorder);
395  }
396 
397  libmesh_error_msg("We'll never get here!");
398  return 0.;
399 }
libmesh_assert(remote_elem)
unsigned int p_level() const
Definition: elem.h:2141
virtual ElemType type() const =0
template<>
Real libMesh::FE< 2, XYZ >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 358 of file fe_xyz_shape_2D.C.

363 {
364  libmesh_error_msg("XYZ polynomials require the element \nbecause the centroid is needed.");
365  return 0.;
366 }
template<>
Real libMesh::FE< 2, XYZ >::shape_second_deriv ( const Elem elem,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point point_in 
)

Definition at line 371 of file fe_xyz_shape_2D.C.

References std::abs(), libMesh::Elem::centroid(), libMesh::libmesh_assert(), std::max(), libMesh::Elem::n_nodes(), libMesh::Elem::p_level(), libMesh::Elem::point(), std::pow(), libMesh::Real, and libMesh::x.

376 {
377 #if LIBMESH_DIM > 1
378 
379  libmesh_assert_less_equal (j, 2);
380  libmesh_assert(elem);
381 
382  Point centroid = elem->centroid();
383  Point max_distance = Point(0.,0.,0.);
384  for (unsigned int p = 0; p < elem->n_nodes(); p++)
385  for (unsigned int d = 0; d < 2; d++)
386  {
387  const Real distance = std::abs(centroid(d) - elem->point(p)(d));
388  max_distance(d) = std::max(distance, max_distance(d));
389  }
390 
391  const Real x = point_in(0);
392  const Real y = point_in(1);
393  const Real xc = centroid(0);
394  const Real yc = centroid(1);
395  const Real distx = max_distance(0);
396  const Real disty = max_distance(1);
397  const Real dx = (x - xc)/distx;
398  const Real dy = (y - yc)/disty;
399  const Real dist2x = pow(distx,2.);
400  const Real dist2y = pow(disty,2.);
401  const Real distxy = distx * disty;
402 
403 #ifndef NDEBUG
404  // totalorder is only used in the assertion below, so
405  // we avoid declaring it when asserts are not active.
406  const unsigned int totalorder = order + elem->p_level();
407 #endif
408  libmesh_assert_less (i, (totalorder+1)*(totalorder+2)/2);
409 
410  // monomials. since they are hierarchic we only need one case block.
411 
412  switch (j)
413  {
414  // d^2()/dx^2
415  case 0:
416  {
417  switch (i)
418  {
419  // constants
420  case 0:
421  // linears
422  case 1:
423  case 2:
424  return 0.;
425 
426  // quadratics
427  case 3:
428  return 2./dist2x;
429 
430  case 4:
431  case 5:
432  return 0.;
433 
434  // cubics
435  case 6:
436  return 6.*dx/dist2x;
437 
438  case 7:
439  return 2.*dy/dist2x;
440 
441  case 8:
442  case 9:
443  return 0.;
444 
445  // quartics
446  case 10:
447  return 12.*dx*dx/dist2x;
448 
449  case 11:
450  return 6.*dx*dy/dist2x;
451 
452  case 12:
453  return 2.*dy*dy/dist2x;
454 
455  case 13:
456  case 14:
457  return 0.;
458 
459  default:
460  unsigned int o = 0;
461  for (; i >= (o+1)*(o+2)/2; o++) { }
462  unsigned int i2 = i - (o*(o+1)/2);
463  Real val = (o - i2) * (o - i2 - 1);
464  for (unsigned int index=i2+2; index < o; index++)
465  val *= dx;
466  for (unsigned int index=0; index != i2; index++)
467  val *= dy;
468  return val/dist2x;
469  }
470  }
471 
472  // d^2()/dxdy
473  case 1:
474  {
475  switch (i)
476  {
477  // constants
478  case 0:
479 
480  // linears
481  case 1:
482  case 2:
483  return 0.;
484 
485  // quadratics
486  case 3:
487  return 0.;
488 
489  case 4:
490  return 1./distxy;
491 
492  case 5:
493  return 0.;
494 
495  // cubics
496  case 6:
497  return 0.;
498  case 7:
499  return 2.*dx/distxy;
500 
501  case 8:
502  return 2.*dy/distxy;
503 
504  case 9:
505  return 0.;
506 
507  // quartics
508  case 10:
509  return 0.;
510 
511  case 11:
512  return 3.*dx*dx/distxy;
513 
514  case 12:
515  return 4.*dx*dy/distxy;
516 
517  case 13:
518  return 3.*dy*dy/distxy;
519 
520  case 14:
521  return 0.;
522 
523  default:
524  unsigned int o = 0;
525  for (; i >= (o+1)*(o+2)/2; o++) { }
526  unsigned int i2 = i - (o*(o+1)/2);
527  Real val = (o - i2) * i2;
528  for (unsigned int index=i2+1; index < o; index++)
529  val *= dx;
530  for (unsigned int index=1; index < i2; index++)
531  val *= dy;
532  return val/distxy;
533  }
534  }
535 
536  // d^2()/dy^2
537  case 2:
538  {
539  switch (i)
540  {
541  // constants
542  case 0:
543 
544  // linears
545  case 1:
546  case 2:
547  return 0.;
548 
549  // quadratics
550  case 3:
551  case 4:
552  return 0.;
553 
554  case 5:
555  return 2./dist2y;
556 
557  // cubics
558  case 6:
559  return 0.;
560 
561  case 7:
562  return 0.;
563 
564  case 8:
565  return 2.*dx/dist2y;
566 
567  case 9:
568  return 6.*dy/dist2y;
569 
570  // quartics
571  case 10:
572  case 11:
573  return 0.;
574 
575  case 12:
576  return 2.*dx*dx/dist2y;
577 
578  case 13:
579  return 6.*dx*dy/dist2y;
580 
581  case 14:
582  return 12.*dy*dy/dist2y;
583 
584  default:
585  unsigned int o = 0;
586  for (; i >= (o+1)*(o+2)/2; o++) { }
587  unsigned int i2 = i - (o*(o+1)/2);
588  Real val = i2 * (i2 - 1);
589  for (unsigned int index=i2; index != o; index++)
590  val *= dx;
591  for (unsigned int index=2; index < i2; index++)
592  val *= dy;
593  return val/dist2y;
594  }
595  }
596 
597  default:
598  libmesh_error_msg("Invalid shape function derivative j = " << j);
599  }
600 
601  libmesh_error_msg("We'll never get here!");
602  return 0.;
603 
604 #endif
605 }
double abs(double a)
libmesh_assert(remote_elem)
long double max(long double a, double b)
PetscErrorCode Vec x
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 379 of file fe_hierarchic_shape_2D.C.

384 {
385  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge orientation is needed.");
386  return 0.;
387 }
template<>
Real libMesh::FE< 2, L2_HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 380 of file fe_l2_hierarchic_shape_2D.C.

385 {
386  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge orientation is needed.");
387  return 0.;
388 }
template<>
Real libMesh::FE< 1, BERNSTEIN >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 380 of file fe_bernstein_shape_1D.C.

References libMesh::err.

385 {
386  static bool warning_given = false;
387 
388  if (!warning_given)
389  libMesh::err << "Second derivatives for Bernstein elements "
390  << "are not yet implemented!"
391  << std::endl;
392 
393  warning_given = true;
394  return 0.;
395 }
OStreamProxy err(std::cerr)
template<>
Real libMesh::FE< 2, HIERARCHIC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 392 of file fe_hierarchic_shape_2D.C.

References libMesh::invalid_uint, libMesh::libmesh_assert(), and libMesh::Real.

397 {
398  libmesh_assert(elem);
399 
400  // I have been lazy here and am using finite differences
401  // to compute the derivatives!
402  const Real eps = 1.e-6;
403  Point pp, pm;
404  unsigned int prevj = libMesh::invalid_uint;
405 
406  switch (j)
407  {
408  // d^2()/dxi^2
409  case 0:
410  {
411  pp = Point(p(0)+eps, p(1));
412  pm = Point(p(0)-eps, p(1));
413  prevj = 0;
414  break;
415  }
416 
417  // d^2()/dxideta
418  case 1:
419  {
420  pp = Point(p(0), p(1)+eps);
421  pm = Point(p(0), p(1)-eps);
422  prevj = 0;
423  break;
424  }
425 
426  // d^2()/deta^2
427  case 2:
428  {
429  pp = Point(p(0), p(1)+eps);
430  pm = Point(p(0), p(1)-eps);
431  prevj = 1;
432  break;
433  }
434  default:
435  libmesh_error_msg("Invalid derivative index j = " << j);
436  }
437 
438  return (FE<2,HIERARCHIC>::shape_deriv(elem, order, i, prevj, pp) -
439  FE<2,HIERARCHIC>::shape_deriv(elem, order, i, prevj, pm)
440  )/2./eps;
441 }
const unsigned int invalid_uint
Definition: libmesh.h:185
libmesh_assert(remote_elem)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, L2_HIERARCHIC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 393 of file fe_l2_hierarchic_shape_2D.C.

References libMesh::invalid_uint, libMesh::libmesh_assert(), and libMesh::Real.

398 {
399  libmesh_assert(elem);
400 
401  // I have been lazy here and am using finite differences
402  // to compute the derivatives!
403  const Real eps = 1.e-6;
404  Point pp, pm;
405  unsigned int prevj = libMesh::invalid_uint;
406 
407  switch (j)
408  {
409  // d^2()/dxi^2
410  case 0:
411  {
412  pp = Point(p(0)+eps, p(1));
413  pm = Point(p(0)-eps, p(1));
414  prevj = 0;
415  break;
416  }
417 
418  // d^2()/dxideta
419  case 1:
420  {
421  pp = Point(p(0), p(1)+eps);
422  pm = Point(p(0), p(1)-eps);
423  prevj = 0;
424  break;
425  }
426 
427  // d^2()/deta^2
428  case 2:
429  {
430  pp = Point(p(0), p(1)+eps);
431  pm = Point(p(0), p(1)-eps);
432  prevj = 1;
433  break;
434  }
435  default:
436  libmesh_error_msg("Invalid derivative index j = " << j);
437  }
438  return (FE<2,L2_HIERARCHIC>::shape_deriv(elem, order, i, prevj, pp) -
439  FE<2,L2_HIERARCHIC>::shape_deriv(elem, order, i, prevj, pm)
440  )/2./eps;
441 }
const unsigned int invalid_uint
Definition: libmesh.h:185
libmesh_assert(remote_elem)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 1, BERNSTEIN >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 401 of file fe_bernstein_shape_1D.C.

References libMesh::err.

406 {
407  static bool warning_given = false;
408 
409  if (!warning_given)
410  libMesh::err << "Second derivatives for Bernstein elements "
411  << "are not yet implemented!"
412  << std::endl;
413 
414  warning_given = true;
415  return 0.;
416 }
OStreamProxy err(std::cerr)
template<>
RealGradient libMesh::FE< 3, NEDELEC_ONE >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 493 of file fe_nedelec_one_shape_3D.C.

498 {
499  libmesh_error_msg("Nedelec elements require the element type \nbecause edge orientation is needed.");
500  return RealGradient();
501 }
RealVectorValue RealGradient
template<>
RealGradient libMesh::FE< 3, NEDELEC_ONE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point libmesh_dbg_var
)

Definition at line 506 of file fe_nedelec_one_shape_3D.C.

References libMesh::FIRST, libMesh::HEX20, libMesh::HEX27, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::Real, libMesh::TET10, libMesh::TOLERANCE, and libMesh::Elem::type().

511 {
512 #if LIBMESH_DIM == 3
513 
514  libmesh_assert(elem);
515 
516  // j = 0 ==> d^2 phi / dxi^2
517  // j = 1 ==> d^2 phi / dxi deta
518  // j = 2 ==> d^2 phi / deta^2
519  // j = 3 ==> d^2 phi / dxi dzeta
520  // j = 4 ==> d^2 phi / deta dzeta
521  // j = 5 ==> d^2 phi / dzeta^2
522  libmesh_assert_less (j, 6);
523 
524  const Order totalorder = static_cast<Order>(order + elem->p_level());
525 
526  switch (totalorder)
527  {
528  // linear Lagrange shape functions
529  case FIRST:
530  {
531  switch (elem->type())
532  {
533  case HEX20:
534  case HEX27:
535  {
536  libmesh_assert_less (i, 12);
537 
538 #ifndef NDEBUG
539  const Real xi = p(0);
540  const Real eta = p(1);
541  const Real zeta = p(2);
542 #endif
543 
544  libmesh_assert_less_equal ( std::fabs(xi), 1.0+TOLERANCE );
545  libmesh_assert_less_equal ( std::fabs(eta), 1.0+TOLERANCE );
546  libmesh_assert_less_equal ( std::fabs(zeta), 1.0+TOLERANCE );
547 
548  switch (j)
549  {
550  // d^2()/dxi^2
551  case 0:
552  {
553  // All d^2()/dxi^2 derivatives for linear hexes are zero.
554  return RealGradient();
555  } // j=0
556 
557  // d^2()/dxideta
558  case 1:
559  {
560  switch(i)
561  {
562  case 0:
563  case 1:
564  case 2:
565  case 3:
566  case 8:
567  case 9:
568  case 10:
569  case 11:
570  return RealGradient();
571  case 4:
572  {
573  if( elem->point(0) > elem->point(4) )
574  return RealGradient( 0.0, 0.0, -0.125 );
575  else
576  return RealGradient( 0.0, 0.0, 0.125 );
577  }
578  case 5:
579  {
580  if( elem->point(1) > elem->point(5) )
581  return RealGradient( 0.0, 0.0, 0.125 );
582  else
583  return RealGradient( 0.0, 0.0, -0.125 );
584  }
585  case 6:
586  {
587  if( elem->point(2) > elem->point(6) )
588  return RealGradient( 0.0, 0.0, -0.125 );
589  else
590  return RealGradient( 0.0, 0.0, 0.125 );
591  }
592  case 7:
593  {
594  if( elem->point(3) > elem->point(7) )
595  return RealGradient( 0.0, 0.0, 0.125 );
596  else
597  return RealGradient( 0.0, 0.0, -0.125 );
598  }
599  default:
600  libmesh_error_msg("Invalid i = " << i);
601  } // switch(i)
602 
603  } // j=1
604 
605  // d^2()/deta^2
606  case 2:
607  {
608  // All d^2()/deta^2 derivatives for linear hexes are zero.
609  return RealGradient();
610  } // j = 2
611 
612  // d^2()/dxidzeta
613  case 3:
614  {
615  switch(i)
616  {
617  case 0:
618  case 2:
619  case 4:
620  case 5:
621  case 6:
622  case 7:
623  case 8:
624  case 10:
625  return RealGradient();
626 
627  case 1:
628  {
629  if( elem->point(1) > elem->point(2) )
630  return RealGradient( 0.0, 0.125 );
631  else
632  return RealGradient( 0.0, -0.125 );
633  }
634  case 3:
635  {
636  if( elem->point(3) > elem->point(0) )
637  return RealGradient( 0.0, -0.125 );
638  else
639  return RealGradient( 0.0, 0.125 );
640  }
641  case 9:
642  {
643  if( elem->point(5) > elem->point(6) )
644  return RealGradient( 0.0, -0.125, 0.0 );
645  else
646  return RealGradient( 0.0, 0.125, 0.0 );
647  }
648  case 11:
649  {
650  if( elem->point(4) > elem->point(7) )
651  return RealGradient( 0.0, 0.125, 0.0 );
652  else
653  return RealGradient( 0.0, -0.125, 0.0 );
654  }
655  default:
656  libmesh_error_msg("Invalid i = " << i);
657  } // switch(i)
658 
659  } // j = 3
660 
661  // d^2()/detadzeta
662  case 4:
663  {
664  switch(i)
665  {
666  case 1:
667  case 3:
668  case 4:
669  case 5:
670  case 6:
671  case 7:
672  case 9:
673  case 11:
674  return RealGradient();
675 
676  case 0:
677  {
678  if( elem->point(0) > elem->point(1) )
679  return RealGradient( -0.125, 0.0, 0.0 );
680  else
681  return RealGradient( 0.125, 0.0, 0.0 );
682  }
683  case 2:
684  {
685  if( elem->point(2) > elem->point(3) )
686  return RealGradient( 0.125, 0.0, 0.0 );
687  else
688  return RealGradient( -0.125, 0.0, 0.0 );
689  }
690  case 8:
691  {
692  if( elem->point(4) > elem->point(5) )
693  return RealGradient( 0.125, 0.0, 0.0 );
694  else
695  return RealGradient( -0.125, 0.0, 0.0 );
696  }
697  case 10:
698  {
699  if( elem->point(7) > elem->point(6) )
700  return RealGradient( -0.125, 0.0, 0.0 );
701  else
702  return RealGradient( 0.125, 0.0, 0.0 );
703  }
704  default:
705  libmesh_error_msg("Invalid i = " << i);
706  } // switch(i)
707 
708  } // j = 4
709 
710  // d^2()/dzeta^2
711  case 5:
712  {
713  // All d^2()/dzeta^2 derivatives for linear hexes are zero.
714  return RealGradient();
715  } // j = 5
716 
717  default:
718  libmesh_error_msg("Invalid j = " << j);
719  }
720 
721  return RealGradient();
722  }
723 
724  case TET10:
725  {
726  libmesh_assert_less (i, 6);
727 
728  libmesh_not_implemented();
729  return RealGradient();
730  }
731 
732  default:
733  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << elem->type());
734 
735  } //switch(type)
736 
737  } // case FIRST:
738  // unsupported order
739  default:
740  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << totalorder);
741  }
742 
743 #endif
744 
745  libmesh_error_msg("We'll never get here!");
746  return RealGradient();
747 }
RealVectorValue RealGradient
libmesh_assert(remote_elem)
static const Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, MONOMIAL >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 541 of file fe_monomial_shape_2D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

546 {
547  libmesh_assert(elem);
548 
549  // by default call the orientation-independent shape functions
550  return FE<2,MONOMIAL>::shape_second_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
551 }
libmesh_assert(remote_elem)
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 3, HERMITE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 547 of file fe_hermite_shape_3D.C.

References libMesh::FEHermite< Dim >::hermite_raw_shape(), libMesh::FEHermite< Dim >::hermite_raw_shape_deriv(), libMesh::FEHermite< Dim >::hermite_raw_shape_second_deriv(), libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::Real, libMesh::THIRD, and libMesh::Elem::type().

552 {
553  libmesh_assert(elem);
554 
555  std::vector<std::vector<Real> > dxdxi(3, std::vector<Real>(2, 0));
556 
557 #ifdef DEBUG
558  std::vector<Real> dydxi(2), dzdeta(2), dxdzeta(2);
559  std::vector<Real> dzdxi(2), dxdeta(2), dydzeta(2);
560 #endif //DEBUG
561 
562  hermite_compute_coefs(elem, dxdxi
563 #ifdef DEBUG
564  , dydxi, dzdeta, dxdzeta, dzdxi, dxdeta, dydzeta
565 #endif
566  );
567 
568  const ElemType type = elem->type();
569 
570  const Order totalorder = static_cast<Order>(order + elem->p_level());
571 
572  switch (totalorder)
573  {
574  // 3rd-order tricubic Hermite functions
575  case THIRD:
576  {
577  switch (type)
578  {
579  case HEX8:
580  case HEX20:
581  case HEX27:
582  {
583  libmesh_assert_less (i, 64);
584 
585  std::vector<unsigned int> bases1D;
586 
587  Real coef = hermite_bases_3D(bases1D, dxdxi, totalorder, i);
588 
589  switch (j) // Derivative type
590  {
591  case 0:
592  return coef *
594  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1)) *
595  FEHermite<1>::hermite_raw_shape(bases1D[2],p(2));
596  break;
597  case 1:
598  return coef *
599  FEHermite<1>::hermite_raw_shape_deriv(bases1D[0],p(0)) *
600  FEHermite<1>::hermite_raw_shape_deriv(bases1D[1],p(1)) *
601  FEHermite<1>::hermite_raw_shape(bases1D[2],p(2));
602  break;
603  case 2:
604  return coef *
605  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
607  FEHermite<1>::hermite_raw_shape(bases1D[2],p(2));
608  break;
609  case 3:
610  return coef *
611  FEHermite<1>::hermite_raw_shape_deriv(bases1D[0],p(0)) *
612  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1)) *
613  FEHermite<1>::hermite_raw_shape_deriv(bases1D[2],p(2));
614  break;
615  case 4:
616  return coef *
617  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
618  FEHermite<1>::hermite_raw_shape_deriv(bases1D[1],p(1)) *
619  FEHermite<1>::hermite_raw_shape_deriv(bases1D[2],p(2));
620  break;
621  case 5:
622  return coef *
623  FEHermite<1>::hermite_raw_shape(bases1D[0],p(0)) *
624  FEHermite<1>::hermite_raw_shape(bases1D[1],p(1)) *
626  break;
627  default:
628  libmesh_error_msg("Invalid shape function derivative j = " << j);
629  }
630 
631  }
632  default:
633  libmesh_error_msg("ERROR: Unsupported element type " << type);
634  }
635  }
636  // by default throw an error
637  default:
638  libmesh_error_msg("ERROR: Unsupported polynomial order " << totalorder);
639  }
640 
641  libmesh_error_msg("We'll never get here!");
642  return 0.;
643 }
libmesh_assert(remote_elem)
unsigned int p_level() const
Definition: elem.h:2141
static Real hermite_raw_shape_second_deriv(const unsigned int basis_num, const Real xi)
static Real hermite_raw_shape(const unsigned int basis_num, const Real xi)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static Real hermite_raw_shape_deriv(const unsigned int basis_num, const Real xi)
virtual ElemType type() const =0
template<>
RealGradient libMesh::FE< 0, LAGRANGE_VEC >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 551 of file fe_lagrange_vec.C.

References libMesh::Real, and libMesh::FE< Dim, T >::shape_second_deriv().

554 {
555  Real value = FE<0,LAGRANGE>::shape_second_deriv( type, order, i, j, p );
556  return libMesh::RealGradient( value );
557 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 2, SUBDIVISION >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)
template<>
Real libMesh::FE< 2, BERNSTEIN >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 565 of file fe_bernstein_shape_2D.C.

References libMesh::err.

570 {
571  static bool warning_given = false;
572 
573  if (!warning_given)
574  libMesh::err << "Second derivatives for Bernstein elements "
575  << "are not yet implemented!"
576  << std::endl;
577 
578  warning_given = true;
579  return 0.;
580 }
OStreamProxy err(std::cerr)
template<>
Real libMesh::FE< 2, LAGRANGE >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 568 of file fe_lagrange_shape_2D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::FIRST, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::Real, libMesh::SECOND, libMesh::TRI3, libMesh::TRI6, and libMesh::TRISHELL3.

573 {
574 #if LIBMESH_DIM > 1
575 
576  // j = 0 ==> d^2 phi / dxi^2
577  // j = 1 ==> d^2 phi / dxi deta
578  // j = 2 ==> d^2 phi / deta^2
579  libmesh_assert_less (j, 3);
580 
581  switch (order)
582  {
583  // linear Lagrange shape functions
584  case FIRST:
585  {
586  switch (type)
587  {
588  case QUAD4:
589  case QUADSHELL4:
590  case QUAD8:
591  case QUAD9:
592  {
593  // Compute quad shape functions as a tensor-product
594  const Real xi = p(0);
595  const Real eta = p(1);
596 
597  libmesh_assert_less (i, 4);
598 
599  // 0 1 2 3
600  static const unsigned int i0[] = {0, 1, 1, 0};
601  static const unsigned int i1[] = {0, 0, 1, 1};
602 
603  switch (j)
604  {
605  // d^2() / dxi^2
606  case 0:
607  return 0.;
608 
609  // d^2() / dxi deta
610  case 1:
611  return (FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
612  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta));
613 
614  // d^2() / deta^2
615  case 2:
616  return 0.;
617 
618  default:
619  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
620  }
621  }
622 
623  case TRI3:
624  case TRISHELL3:
625  case TRI6:
626  {
627  // All second derivatives for linear triangles are zero.
628  return 0.;
629  }
630 
631  default:
632  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
633 
634  } // end switch (type)
635  } // end case FIRST
636 
637 
638  // quadratic Lagrange shape functions
639  case SECOND:
640  {
641  switch (type)
642  {
643  case QUAD8:
644  {
645  const Real xi = p(0);
646  const Real eta = p(1);
647 
648  libmesh_assert_less (j, 3);
649 
650  switch (j)
651  {
652  // d^2() / dxi^2
653  case 0:
654  {
655  switch (i)
656  {
657  case 0:
658  case 1:
659  return 0.5*(1.-eta);
660 
661  case 2:
662  case 3:
663  return 0.5*(1.+eta);
664 
665  case 4:
666  return eta - 1.;
667 
668  case 5:
669  case 7:
670  return 0.0;
671 
672  case 6:
673  return -1. - eta;
674 
675  default:
676  libmesh_error_msg("Invalid shape function index i = " << i);
677  }
678  }
679 
680  // d^2() / dxi deta
681  case 1:
682  {
683  switch (i)
684  {
685  case 0:
686  return 0.25*( 1. - 2.*xi - 2.*eta);
687 
688  case 1:
689  return 0.25*(-1. - 2.*xi + 2.*eta);
690 
691  case 2:
692  return 0.25*( 1. + 2.*xi + 2.*eta);
693 
694  case 3:
695  return 0.25*(-1. + 2.*xi - 2.*eta);
696 
697  case 4:
698  return xi;
699 
700  case 5:
701  return -eta;
702 
703  case 6:
704  return -xi;
705 
706  case 7:
707  return eta;
708 
709  default:
710  libmesh_error_msg("Invalid shape function index i = " << i);
711  }
712  }
713 
714  // d^2() / deta^2
715  case 2:
716  {
717  switch (i)
718  {
719  case 0:
720  case 3:
721  return 0.5*(1.-xi);
722 
723  case 1:
724  case 2:
725  return 0.5*(1.+xi);
726 
727  case 4:
728  case 6:
729  return 0.0;
730 
731  case 5:
732  return -1.0 - xi;
733 
734  case 7:
735  return xi - 1.0;
736 
737  default:
738  libmesh_error_msg("Invalid shape function index i = " << i);
739  }
740  }
741 
742  default:
743  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
744  } // end switch (j)
745  } // end case QUAD8
746 
747  case QUAD9:
748  {
749  // Compute QUAD9 second derivatives as tensor product
750  const Real xi = p(0);
751  const Real eta = p(1);
752 
753  libmesh_assert_less (i, 9);
754 
755  // 0 1 2 3 4 5 6 7 8
756  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
757  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
758 
759  switch (j)
760  {
761  // d^2() / dxi^2
762  case 0:
763  return (FE<1,LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i0[i], 0, xi)*
764  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta));
765 
766  // d^2() / dxi deta
767  case 1:
768  return (FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
769  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta));
770 
771  // d^2() / deta^2
772  case 2:
773  return (FE<1,LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
774  FE<1,LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i1[i], 0, eta));
775 
776  default:
777  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
778  } // end switch (j)
779  } // end case QUAD9
780 
781  case TRI6:
782  {
783  const Real dzeta0dxi = -1.;
784  const Real dzeta1dxi = 1.;
785  const Real dzeta2dxi = 0.;
786 
787  const Real dzeta0deta = -1.;
788  const Real dzeta1deta = 0.;
789  const Real dzeta2deta = 1.;
790 
791  libmesh_assert_less (j, 3);
792 
793  switch (j)
794  {
795  // d^2() / dxi^2
796  case 0:
797  {
798  switch (i)
799  {
800  case 0:
801  return 4.*dzeta0dxi*dzeta0dxi;
802 
803  case 1:
804  return 4.*dzeta1dxi*dzeta1dxi;
805 
806  case 2:
807  return 4.*dzeta2dxi*dzeta2dxi;
808 
809  case 3:
810  return 8.*dzeta0dxi*dzeta1dxi;
811 
812  case 4:
813  return 8.*dzeta1dxi*dzeta2dxi;
814 
815  case 5:
816  return 8.*dzeta0dxi*dzeta2dxi;
817 
818  default:
819  libmesh_error_msg("Invalid shape function index i = " << i);
820  }
821  }
822 
823  // d^2() / dxi deta
824  case 1:
825  {
826  switch (i)
827  {
828  case 0:
829  return 4.*dzeta0dxi*dzeta0deta;
830 
831  case 1:
832  return 4.*dzeta1dxi*dzeta1deta;
833 
834  case 2:
835  return 4.*dzeta2dxi*dzeta2deta;
836 
837  case 3:
838  return 4.*dzeta1deta*dzeta0dxi + 4.*dzeta0deta*dzeta1dxi;
839 
840  case 4:
841  return 4.*dzeta2deta*dzeta1dxi + 4.*dzeta1deta*dzeta2dxi;
842 
843  case 5:
844  return 4.*dzeta2deta*dzeta0dxi + 4.*dzeta0deta*dzeta2dxi;
845 
846  default:
847  libmesh_error_msg("Invalid shape function index i = " << i);
848  }
849  }
850 
851  // d^2() / deta^2
852  case 2:
853  {
854  switch (i)
855  {
856  case 0:
857  return 4.*dzeta0deta*dzeta0deta;
858 
859  case 1:
860  return 4.*dzeta1deta*dzeta1deta;
861 
862  case 2:
863  return 4.*dzeta2deta*dzeta2deta;
864 
865  case 3:
866  return 8.*dzeta0deta*dzeta1deta;
867 
868  case 4:
869  return 8.*dzeta1deta*dzeta2deta;
870 
871  case 5:
872  return 8.*dzeta0deta*dzeta2deta;
873 
874  default:
875  libmesh_error_msg("Invalid shape function index i = " << i);
876  }
877  }
878 
879  default:
880  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
881  } // end switch (j)
882  } // end case TRI6
883 
884  default:
885  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
886  }
887  } // end case SECOND
888 
889 
890 
891  // unsupported order
892  default:
893  libmesh_error_msg("ERROR: Unsupported 2D FE order: " << order);
894 
895  } // end switch (order)
896 
897  libmesh_error_msg("We'll never get here!");
898 #endif // LIBMESH_DIM > 1
899  return 0.;
900 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, L2_LAGRANGE >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 572 of file fe_l2_lagrange_shape_2D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::FIRST, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::Real, libMesh::SECOND, libMesh::TRI3, libMesh::TRI6, and libMesh::TRISHELL3.

577 {
578 #if LIBMESH_DIM > 1
579 
580  // j = 0 ==> d^2 phi / dxi^2
581  // j = 1 ==> d^2 phi / dxi deta
582  // j = 2 ==> d^2 phi / deta^2
583  libmesh_assert_less (j, 3);
584 
585  switch (order)
586  {
587  // linear Lagrange shape functions
588  case FIRST:
589  {
590  switch (type)
591  {
592  case QUAD4:
593  case QUADSHELL4:
594  case QUAD8:
595  case QUAD9:
596  {
597  // Compute quad shape functions as a tensor-product
598  const Real xi = p(0);
599  const Real eta = p(1);
600 
601  libmesh_assert_less (i, 4);
602 
603  // 0 1 2 3
604  static const unsigned int i0[] = {0, 1, 1, 0};
605  static const unsigned int i1[] = {0, 0, 1, 1};
606 
607  switch (j)
608  {
609  // d^2() / dxi^2
610  case 0:
611  return 0.;
612 
613  // d^2() / dxi deta
614  case 1:
615  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
616  FE<1,L2_LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta));
617 
618  // d^2() / deta^2
619  case 2:
620  return 0.;
621 
622  default:
623  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
624  }
625  }
626 
627  case TRI3:
628  case TRISHELL3:
629  case TRI6:
630  {
631  // All second derivatives for linear triangles are zero.
632  return 0.;
633  }
634 
635  default:
636  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
637 
638  } // end switch (type)
639  } // end case FIRST
640 
641 
642  // quadratic Lagrange shape functions
643  case SECOND:
644  {
645  switch (type)
646  {
647  case QUAD8:
648  {
649  const Real xi = p(0);
650  const Real eta = p(1);
651 
652  libmesh_assert_less (j, 3);
653 
654  switch (j)
655  {
656  // d^2() / dxi^2
657  case 0:
658  {
659  switch (i)
660  {
661  case 0:
662  case 1:
663  return 0.5*(1.-eta);
664 
665  case 2:
666  case 3:
667  return 0.5*(1.+eta);
668 
669  case 4:
670  return eta - 1.;
671 
672  case 5:
673  case 7:
674  return 0.0;
675 
676  case 6:
677  return -1. - eta;
678 
679  default:
680  libmesh_error_msg("Invalid shape function index i = " << i);
681  }
682  }
683 
684  // d^2() / dxi deta
685  case 1:
686  {
687  switch (i)
688  {
689  case 0:
690  return 0.25*( 1. - 2.*xi - 2.*eta);
691 
692  case 1:
693  return 0.25*(-1. - 2.*xi + 2.*eta);
694 
695  case 2:
696  return 0.25*( 1. + 2.*xi + 2.*eta);
697 
698  case 3:
699  return 0.25*(-1. + 2.*xi - 2.*eta);
700 
701  case 4:
702  return xi;
703 
704  case 5:
705  return -eta;
706 
707  case 6:
708  return -xi;
709 
710  case 7:
711  return eta;
712 
713  default:
714  libmesh_error_msg("Invalid shape function index i = " << i);
715  }
716  }
717 
718  // d^2() / deta^2
719  case 2:
720  {
721  switch (i)
722  {
723  case 0:
724  case 3:
725  return 0.5*(1.-xi);
726 
727  case 1:
728  case 2:
729  return 0.5*(1.+xi);
730 
731  case 4:
732  case 6:
733  return 0.0;
734 
735  case 5:
736  return -1.0 - xi;
737 
738  case 7:
739  return xi - 1.0;
740 
741  default:
742  libmesh_error_msg("Invalid shape function index i = " << i);
743  }
744  }
745 
746 
747  default:
748  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
749  } // end switch (j)
750  } // end case QUAD8
751 
752  case QUAD9:
753  {
754  // Compute QUAD9 second derivatives as tensor product
755  const Real xi = p(0);
756  const Real eta = p(1);
757 
758  libmesh_assert_less (i, 9);
759 
760  // 0 1 2 3 4 5 6 7 8
761  static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
762  static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
763 
764  switch (j)
765  {
766  // d^2() / dxi^2
767  case 0:
768  return (FE<1,L2_LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i0[i], 0, xi)*
769  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta));
770 
771  // d^2() / dxi deta
772  case 1:
773  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
774  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta));
775 
776  // d^2() / deta^2
777  case 2:
778  return (FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
779  FE<1,L2_LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i1[i], 0, eta));
780 
781  default:
782  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
783  } // end switch (j)
784  } // end case QUAD9
785 
786  case TRI6:
787  {
788  const Real dzeta0dxi = -1.;
789  const Real dzeta1dxi = 1.;
790  const Real dzeta2dxi = 0.;
791 
792  const Real dzeta0deta = -1.;
793  const Real dzeta1deta = 0.;
794  const Real dzeta2deta = 1.;
795 
796  libmesh_assert_less (j, 3);
797 
798  switch (j)
799  {
800  // d^2() / dxi^2
801  case 0:
802  {
803  switch (i)
804  {
805  case 0:
806  return 4.*dzeta0dxi*dzeta0dxi;
807 
808  case 1:
809  return 4.*dzeta1dxi*dzeta1dxi;
810 
811  case 2:
812  return 4.*dzeta2dxi*dzeta2dxi;
813 
814  case 3:
815  return 8.*dzeta0dxi*dzeta1dxi;
816 
817  case 4:
818  return 8.*dzeta1dxi*dzeta2dxi;
819 
820  case 5:
821  return 8.*dzeta0dxi*dzeta2dxi;
822 
823  default:
824  libmesh_error_msg("Invalid shape function index i = " << i);
825  }
826  }
827 
828  // d^2() / dxi deta
829  case 1:
830  {
831  switch (i)
832  {
833  case 0:
834  return 4.*dzeta0dxi*dzeta0deta;
835 
836  case 1:
837  return 4.*dzeta1dxi*dzeta1deta;
838 
839  case 2:
840  return 4.*dzeta2dxi*dzeta2deta;
841 
842  case 3:
843  return 4.*dzeta1deta*dzeta0dxi + 4.*dzeta0deta*dzeta1dxi;
844 
845  case 4:
846  return 4.*dzeta2deta*dzeta1dxi + 4.*dzeta1deta*dzeta2dxi;
847 
848  case 5:
849  return 4.*dzeta2deta*dzeta0dxi + 4.*dzeta0deta*dzeta2dxi;
850 
851  default:
852  libmesh_error_msg("Invalid shape function index i = " << i);
853  }
854  }
855 
856  // d^2() / deta^2
857  case 2:
858  {
859  switch (i)
860  {
861  case 0:
862  return 4.*dzeta0deta*dzeta0deta;
863 
864  case 1:
865  return 4.*dzeta1deta*dzeta1deta;
866 
867  case 2:
868  return 4.*dzeta2deta*dzeta2deta;
869 
870  case 3:
871  return 8.*dzeta0deta*dzeta1deta;
872 
873  case 4:
874  return 8.*dzeta1deta*dzeta2deta;
875 
876  case 5:
877  return 8.*dzeta0deta*dzeta2deta;
878 
879  default:
880  libmesh_error_msg("Invalid shape function index i = " << i);
881  }
882  }
883 
884  default:
885  libmesh_error_msg("ERROR: Invalid derivative index j = " << j);
886  } // end switch (j)
887  } // end case TRI6
888 
889  default:
890  libmesh_error_msg("ERROR: Unsupported 2D element type: " << type);
891  }
892  } // end case SECOND
893 
894 
895 
896  // unsupported order
897  default:
898  libmesh_error_msg("ERROR: Unsupported 2D FE order: " << order);
899 
900  } // end switch (order)
901 
902 
903  libmesh_error_msg("We'll never get here!");
904  return 0.;
905 #endif // LIBMESH_DIM > 1
906 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
RealGradient libMesh::FE< 1, LAGRANGE_VEC >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 573 of file fe_lagrange_vec.C.

References libMesh::Real, and libMesh::FE< Dim, T >::shape_second_deriv().

576 {
577  Real value = FE<1,LAGRANGE>::shape_second_deriv( type, order, i, j, p );
578  return libMesh::RealGradient( value );
579 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 2, BERNSTEIN >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 585 of file fe_bernstein_shape_2D.C.

References libMesh::err.

590 {
591  static bool warning_given = false;
592 
593  if (!warning_given)
594  libMesh::err << "Second derivatives for Bernstein elements "
595  << "are not yet implemented!"
596  << std::endl;
597 
598  warning_given = true;
599  return 0.;
600 }
OStreamProxy err(std::cerr)
template<>
RealGradient libMesh::FE< 0, NEDELEC_ONE >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 613 of file fe_nedelec_one.C.

615 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
RealGradient libMesh::FE< 0, NEDELEC_ONE >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 617 of file fe_nedelec_one.C.

619 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
RealGradient libMesh::FE< 2, LAGRANGE_VEC >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 623 of file fe_lagrange_vec.C.

References libMesh::Real, and libMesh::FE< Dim, T >::shape_second_deriv().

626 {
627  Real value = FE<2,LAGRANGE>::shape_second_deriv( type, order, i/2, j, p );
628 
629  switch( i%2 )
630  {
631  case 0:
632  return libMesh::RealGradient( value );
633 
634  case 1:
635  return libMesh::RealGradient( Real(0), value );
636 
637  default:
638  libmesh_error_msg("i%2 must be either 0 or 1!");
639  }
640 
641  //dummy
642  return libMesh::RealGradient();
643 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
RealGradient libMesh::FE< 1, NEDELEC_ONE >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 636 of file fe_nedelec_one.C.

638 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
RealGradient libMesh::FE< 1, NEDELEC_ONE >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 640 of file fe_nedelec_one.C.

642 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
Real libMesh::FE< 3, MONOMIAL >::shape_second_deriv ( const ElemType  ,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 655 of file fe_monomial_shape_3D.C.

References libMesh::Real.

660 {
661 #if LIBMESH_DIM == 3
662 
663  libmesh_assert_less (j, 6);
664 
665  libmesh_assert_less (i, (static_cast<unsigned int>(order)+1)*
666  (static_cast<unsigned int>(order)+2)*
667  (static_cast<unsigned int>(order)+3)/6);
668 
669  const Real xi = p(0);
670  const Real eta = p(1);
671  const Real zeta = p(2);
672 
673  // monomials. since they are hierarchic we only need one case block.
674  switch (j)
675  {
676  // d^2()/dxi^2
677  case 0:
678  {
679  switch (i)
680  {
681  // constant
682  case 0:
683 
684  // linear
685  case 1:
686  case 2:
687  case 3:
688  return 0.;
689 
690  // quadratic
691  case 4:
692  return 2.;
693 
694  case 5:
695  case 6:
696  case 7:
697  case 8:
698  case 9:
699  return 0.;
700 
701  // cubic
702  case 10:
703  return 6.*xi;
704 
705  case 11:
706  return 2.*eta;
707 
708  case 12:
709  case 13:
710  return 0.;
711 
712  case 14:
713  return 2.*zeta;
714 
715  case 15:
716  case 16:
717  case 17:
718  case 18:
719  case 19:
720  return 0.;
721 
722  // quartics
723  case 20:
724  return 12.*xi*xi;
725 
726  case 21:
727  return 6.*xi*eta;
728 
729  case 22:
730  return 2.*eta*eta;
731 
732  case 23:
733  case 24:
734  return 0.;
735 
736  case 25:
737  return 6.*xi*zeta;
738 
739  case 26:
740  return 2.*eta*zeta;
741 
742  case 27:
743  case 28:
744  return 0.;
745 
746  case 29:
747  return 2.*zeta*zeta;
748 
749  case 30:
750  case 31:
751  case 32:
752  case 33:
753  case 34:
754  return 0.;
755 
756  default:
757  unsigned int o = 0;
758  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
759  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
760  unsigned int block=o, nz = 0;
761  for (; block < i2; block += (o-nz+1)) { nz++; }
762  const unsigned int nx = block - i2;
763  const unsigned int ny = o - nx - nz;
764  Real val = nx * (nx - 1);
765  for (unsigned int index=2; index < nx; index++)
766  val *= xi;
767  for (unsigned int index=0; index != ny; index++)
768  val *= eta;
769  for (unsigned int index=0; index != nz; index++)
770  val *= zeta;
771  return val;
772  }
773  }
774 
775 
776  // d^2()/dxideta
777  case 1:
778  {
779  switch (i)
780  {
781  // constant
782  case 0:
783 
784  // linear
785  case 1:
786  case 2:
787  case 3:
788  return 0.;
789 
790  // quadratic
791  case 4:
792  return 0.;
793 
794  case 5:
795  return 1.;
796 
797  case 6:
798  case 7:
799  case 8:
800  case 9:
801  return 0.;
802 
803  // cubic
804  case 10:
805  return 0.;
806 
807  case 11:
808  return 2.*xi;
809 
810  case 12:
811  return 2.*eta;
812 
813  case 13:
814  case 14:
815  return 0.;
816 
817  case 15:
818  return zeta;
819 
820  case 16:
821  case 17:
822  case 18:
823  case 19:
824  return 0.;
825 
826  // quartics
827  case 20:
828  return 0.;
829 
830  case 21:
831  return 3.*xi*xi;
832 
833  case 22:
834  return 4.*xi*eta;
835 
836  case 23:
837  return 3.*eta*eta;
838 
839  case 24:
840  case 25:
841  return 0.;
842 
843  case 26:
844  return 2.*xi*zeta;
845 
846  case 27:
847  return 2.*eta*zeta;
848 
849  case 28:
850  case 29:
851  return 0.;
852 
853  case 30:
854  return zeta*zeta;
855 
856  case 31:
857  case 32:
858  case 33:
859  case 34:
860  return 0.;
861 
862  default:
863  unsigned int o = 0;
864  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
865  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
866  unsigned int block=o, nz = 0;
867  for (; block < i2; block += (o-nz+1)) { nz++; }
868  const unsigned int nx = block - i2;
869  const unsigned int ny = o - nx - nz;
870  Real val = nx * ny;
871  for (unsigned int index=1; index < nx; index++)
872  val *= xi;
873  for (unsigned int index=1; index < ny; index++)
874  val *= eta;
875  for (unsigned int index=0; index != nz; index++)
876  val *= zeta;
877  return val;
878  }
879  }
880 
881 
882  // d^2()/deta^2
883  case 2:
884  {
885  switch (i)
886  {
887  // constant
888  case 0:
889 
890  // linear
891  case 1:
892  case 2:
893  case 3:
894  return 0.;
895 
896  // quadratic
897  case 4:
898  case 5:
899  return 0.;
900 
901  case 6:
902  return 2.;
903 
904  case 7:
905  case 8:
906  case 9:
907  return 0.;
908 
909  // cubic
910  case 10:
911  case 11:
912  return 0.;
913 
914  case 12:
915  return 2.*xi;
916  case 13:
917  return 6.*eta;
918 
919  case 14:
920  case 15:
921  return 0.;
922 
923  case 16:
924  return 2.*zeta;
925 
926  case 17:
927  case 18:
928  case 19:
929  return 0.;
930 
931  // quartics
932  case 20:
933  case 21:
934  return 0.;
935 
936  case 22:
937  return 2.*xi*xi;
938 
939  case 23:
940  return 6.*xi*eta;
941 
942  case 24:
943  return 12.*eta*eta;
944 
945  case 25:
946  case 26:
947  return 0.;
948 
949  case 27:
950  return 2.*xi*zeta;
951 
952  case 28:
953  return 6.*eta*zeta;
954 
955  case 29:
956  case 30:
957  return 0.;
958 
959  case 31:
960  return 2.*zeta*zeta;
961 
962  case 32:
963  case 33:
964  case 34:
965  return 0.;
966 
967  default:
968  unsigned int o = 0;
969  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
970  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
971  unsigned int block=o, nz = 0;
972  for (; block < i2; block += (o-nz+1)) { nz++; }
973  const unsigned int nx = block - i2;
974  const unsigned int ny = o - nx - nz;
975  Real val = ny * (ny - 1);
976  for (unsigned int index=0; index != nx; index++)
977  val *= xi;
978  for (unsigned int index=2; index < ny; index++)
979  val *= eta;
980  for (unsigned int index=0; index != nz; index++)
981  val *= zeta;
982  return val;
983  }
984  }
985 
986 
987  // d^2()/dxidzeta
988  case 3:
989  {
990  switch (i)
991  {
992  // constant
993  case 0:
994 
995  // linear
996  case 1:
997  case 2:
998  case 3:
999  return 0.;
1000 
1001  // quadratic
1002  case 4:
1003  case 5:
1004  case 6:
1005  return 0.;
1006 
1007  case 7:
1008  return 1.;
1009 
1010  case 8:
1011  case 9:
1012  return 0.;
1013 
1014  // cubic
1015  case 10:
1016  case 11:
1017  case 12:
1018  case 13:
1019  return 0.;
1020 
1021  case 14:
1022  return 2.*xi;
1023 
1024  case 15:
1025  return eta;
1026 
1027  case 16:
1028  return 0.;
1029 
1030  case 17:
1031  return 2.*zeta;
1032 
1033  case 18:
1034  case 19:
1035  return 0.;
1036 
1037  // quartics
1038  case 20:
1039  case 21:
1040  case 22:
1041  case 23:
1042  case 24:
1043  return 0.;
1044 
1045  case 25:
1046  return 3.*xi*xi;
1047 
1048  case 26:
1049  return 2.*xi*eta;
1050 
1051  case 27:
1052  return eta*eta;
1053 
1054  case 28:
1055  return 0.;
1056 
1057  case 29:
1058  return 4.*xi*zeta;
1059 
1060  case 30:
1061  return 2.*eta*zeta;
1062 
1063  case 31:
1064  return 0.;
1065 
1066  case 32:
1067  return 3.*zeta*zeta;
1068 
1069  case 33:
1070  case 34:
1071  return 0.;
1072 
1073  default:
1074  unsigned int o = 0;
1075  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1076  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1077  unsigned int block=o, nz = 0;
1078  for (; block < i2; block += (o-nz+1)) { nz++; }
1079  const unsigned int nx = block - i2;
1080  const unsigned int ny = o - nx - nz;
1081  Real val = nx * nz;
1082  for (unsigned int index=1; index < nx; index++)
1083  val *= xi;
1084  for (unsigned int index=0; index != ny; index++)
1085  val *= eta;
1086  for (unsigned int index=1; index < nz; index++)
1087  val *= zeta;
1088  return val;
1089  }
1090  }
1091 
1092  // d^2()/detadzeta
1093  case 4:
1094  {
1095  switch (i)
1096  {
1097  // constant
1098  case 0:
1099 
1100  // linear
1101  case 1:
1102  case 2:
1103  case 3:
1104  return 0.;
1105 
1106  // quadratic
1107  case 4:
1108  case 5:
1109  case 6:
1110  case 7:
1111  return 0.;
1112 
1113  case 8:
1114  return 1.;
1115 
1116  case 9:
1117  return 0.;
1118 
1119  // cubic
1120  case 10:
1121  case 11:
1122  case 12:
1123  case 13:
1124  case 14:
1125  return 0.;
1126 
1127  case 15:
1128  return xi;
1129 
1130  case 16:
1131  return 2.*eta;
1132 
1133  case 17:
1134  return 0.;
1135 
1136  case 18:
1137  return 2.*zeta;
1138 
1139  case 19:
1140  return 0.;
1141 
1142  // quartics
1143  case 20:
1144  case 21:
1145  case 22:
1146  case 23:
1147  case 24:
1148  case 25:
1149  return 0.;
1150 
1151  case 26:
1152  return xi*xi;
1153 
1154  case 27:
1155  return 2.*xi*eta;
1156 
1157  case 28:
1158  return 3.*eta*eta;
1159 
1160  case 29:
1161  return 0.;
1162 
1163  case 30:
1164  return 2.*xi*zeta;
1165 
1166  case 31:
1167  return 4.*eta*zeta;
1168 
1169  case 32:
1170  return 0.;
1171 
1172  case 33:
1173  return 3.*zeta*zeta;
1174 
1175  case 34:
1176  return 0.;
1177 
1178  default:
1179  unsigned int o = 0;
1180  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1181  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1182  unsigned int block=o, nz = 0;
1183  for (; block < i2; block += (o-nz+1)) { nz++; }
1184  const unsigned int nx = block - i2;
1185  const unsigned int ny = o - nx - nz;
1186  Real val = ny * nz;
1187  for (unsigned int index=0; index != nx; index++)
1188  val *= xi;
1189  for (unsigned int index=1; index < ny; index++)
1190  val *= eta;
1191  for (unsigned int index=1; index < nz; index++)
1192  val *= zeta;
1193  return val;
1194  }
1195  }
1196 
1197 
1198  // d^2()/dzeta^2
1199  case 5:
1200  {
1201  switch (i)
1202  {
1203  // constant
1204  case 0:
1205 
1206  // linear
1207  case 1:
1208  case 2:
1209  case 3:
1210  return 0.;
1211 
1212  // quadratic
1213  case 4:
1214  case 5:
1215  case 6:
1216  case 7:
1217  case 8:
1218  return 0.;
1219 
1220  case 9:
1221  return 2.;
1222 
1223  // cubic
1224  case 10:
1225  case 11:
1226  case 12:
1227  case 13:
1228  case 14:
1229  case 15:
1230  case 16:
1231  return 0.;
1232 
1233  case 17:
1234  return 2.*xi;
1235 
1236  case 18:
1237  return 2.*eta;
1238 
1239  case 19:
1240  return 6.*zeta;
1241 
1242  // quartics
1243  case 20:
1244  case 21:
1245  case 22:
1246  case 23:
1247  case 24:
1248  case 25:
1249  case 26:
1250  case 27:
1251  case 28:
1252  return 0.;
1253 
1254  case 29:
1255  return 2.*xi*xi;
1256 
1257  case 30:
1258  return 2.*xi*eta;
1259 
1260  case 31:
1261  return 2.*eta*eta;
1262 
1263  case 32:
1264  return 6.*xi*zeta;
1265 
1266  case 33:
1267  return 6.*eta*zeta;
1268 
1269  case 34:
1270  return 12.*zeta*zeta;
1271 
1272  default:
1273  unsigned int o = 0;
1274  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1275  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1276  unsigned int block=o, nz = 0;
1277  for (; block < i2; block += (o-nz+1)) { nz++; }
1278  const unsigned int nx = block - i2;
1279  const unsigned int ny = o - nx - nz;
1280  Real val = nz * (nz - 1);
1281  for (unsigned int index=0; index != nx; index++)
1282  val *= xi;
1283  for (unsigned int index=0; index != ny; index++)
1284  val *= eta;
1285  for (unsigned int index=2; index < nz; index++)
1286  val *= zeta;
1287  return val;
1288  }
1289  }
1290 
1291  default:
1292  libmesh_error_msg("Invalid j = " << j);
1293  }
1294 
1295 #endif
1296 
1297  libmesh_error_msg("We'll never get here!");
1298  return 0.;
1299 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
RealGradient libMesh::FE< 3, LAGRANGE_VEC >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 694 of file fe_lagrange_vec.C.

References libMesh::Real, and libMesh::FE< Dim, T >::shape_second_deriv().

697 {
698  Real value = FE<3,LAGRANGE>::shape_second_deriv( type, order, i/3, j, p );
699 
700  switch( i%3 )
701  {
702  case 0:
703  return libMesh::RealGradient( value );
704 
705  case 1:
706  return libMesh::RealGradient( Real(0), value );
707 
708  case 2:
709  return libMesh::RealGradient( Real(0), Real(0), value );
710 
711  default:
712  libmesh_error_msg("i%3 must be 0, 1, or 2!");
713  }
714 
715  //dummy
716  return libMesh::RealGradient();
717 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 3, XYZ >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 698 of file fe_xyz_shape_3D.C.

703 {
704  libmesh_error_msg("XYZ polynomials require the element \nbecause the centroid is needed.");
705  return 0.;
706 }
template<>
Real libMesh::FE< 3, XYZ >::shape_second_deriv ( const Elem elem,
const Order   libmesh_dbg_varorder,
const unsigned int  i,
const unsigned int  j,
const Point point_in 
)

Definition at line 711 of file fe_xyz_shape_3D.C.

References std::abs(), libMesh::Elem::centroid(), libMesh::libmesh_assert(), std::max(), libMesh::Elem::n_nodes(), libMesh::Elem::p_level(), libMesh::Elem::point(), std::pow(), libMesh::Real, and libMesh::x.

716 {
717 #if LIBMESH_DIM == 3
718 
719  libmesh_assert(elem);
720  libmesh_assert_less (j, 6);
721 
722  Point centroid = elem->centroid();
723  Point max_distance = Point(0.,0.,0.);
724  for (unsigned int p = 0; p < elem->n_nodes(); p++)
725  for (unsigned int d = 0; d < 3; d++)
726  {
727  const Real distance = std::abs(centroid(d) - elem->point(p)(d));
728  max_distance(d) = std::max(distance, max_distance(d));
729  }
730 
731  const Real x = point_in(0);
732  const Real y = point_in(1);
733  const Real z = point_in(2);
734  const Real xc = centroid(0);
735  const Real yc = centroid(1);
736  const Real zc = centroid(2);
737  const Real distx = max_distance(0);
738  const Real disty = max_distance(1);
739  const Real distz = max_distance(2);
740  const Real dx = (x - xc)/distx;
741  const Real dy = (y - yc)/disty;
742  const Real dz = (z - zc)/distz;
743  const Real dist2x = pow(distx,2.);
744  const Real dist2y = pow(disty,2.);
745  const Real dist2z = pow(distz,2.);
746  const Real distxy = distx * disty;
747  const Real distxz = distx * distz;
748  const Real distyz = disty * distz;
749 
750 #ifndef NDEBUG
751  // totalorder is only used in the assertion below, so
752  // we avoid declaring it when asserts are not active.
753  const unsigned int totalorder = static_cast<Order>(order + elem->p_level());
754 #endif
755  libmesh_assert_less (i, (static_cast<unsigned int>(totalorder)+1)*
756  (static_cast<unsigned int>(totalorder)+2)*
757  (static_cast<unsigned int>(totalorder)+3)/6);
758 
759  // monomials. since they are hierarchic we only need one case block.
760  switch (j)
761  {
762  // d^2()/dx^2
763  case 0:
764  {
765  switch (i)
766  {
767  // constant
768  case 0:
769 
770  // linear
771  case 1:
772  case 2:
773  case 3:
774  return 0.;
775 
776  // quadratic
777  case 4:
778  return 2./dist2x;
779 
780  case 5:
781  case 6:
782  case 7:
783  case 8:
784  case 9:
785  return 0.;
786 
787  // cubic
788  case 10:
789  return 6.*dx/dist2x;
790 
791  case 11:
792  return 2.*dy/dist2x;
793 
794  case 12:
795  case 13:
796  return 0.;
797 
798  case 14:
799  return 2.*dz/dist2x;
800 
801  case 15:
802  case 16:
803  case 17:
804  case 18:
805  case 19:
806  return 0.;
807 
808  // quartics
809  case 20:
810  return 12.*dx*dx/dist2x;
811 
812  case 21:
813  return 6.*dx*dy/dist2x;
814 
815  case 22:
816  return 2.*dy*dy/dist2x;
817 
818  case 23:
819  case 24:
820  return 0.;
821 
822  case 25:
823  return 6.*dx*dz/dist2x;
824 
825  case 26:
826  return 2.*dy*dz/dist2x;
827 
828  case 27:
829  case 28:
830  return 0.;
831 
832  case 29:
833  return 2.*dz*dz/dist2x;
834 
835  case 30:
836  case 31:
837  case 32:
838  case 33:
839  case 34:
840  return 0.;
841 
842  default:
843  unsigned int o = 0;
844  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
845  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
846  unsigned int block=o, nz = 0;
847  for (; block < i2; block += (o-nz+1)) { nz++; }
848  const unsigned int nx = block - i2;
849  const unsigned int ny = o - nx - nz;
850  Real val = nx * (nx - 1);
851  for (unsigned int index=2; index < nx; index++)
852  val *= dx;
853  for (unsigned int index=0; index != ny; index++)
854  val *= dy;
855  for (unsigned int index=0; index != nz; index++)
856  val *= dz;
857  return val/dist2x;
858  }
859  }
860 
861 
862  // d^2()/dxdy
863  case 1:
864  {
865  switch (i)
866  {
867  // constant
868  case 0:
869 
870  // linear
871  case 1:
872  case 2:
873  case 3:
874  return 0.;
875 
876  // quadratic
877  case 4:
878  return 0.;
879 
880  case 5:
881  return 1./distxy;
882 
883  case 6:
884  case 7:
885  case 8:
886  case 9:
887  return 0.;
888 
889  // cubic
890  case 10:
891  return 0.;
892 
893  case 11:
894  return 2.*dx/distxy;
895 
896  case 12:
897  return 2.*dy/distxy;
898 
899  case 13:
900  case 14:
901  return 0.;
902 
903  case 15:
904  return dz/distxy;
905 
906  case 16:
907  case 17:
908  case 18:
909  case 19:
910  return 0.;
911 
912  // quartics
913  case 20:
914  return 0.;
915 
916  case 21:
917  return 3.*dx*dx/distxy;
918 
919  case 22:
920  return 4.*dx*dy/distxy;
921 
922  case 23:
923  return 3.*dy*dy/distxy;
924 
925  case 24:
926  case 25:
927  return 0.;
928 
929  case 26:
930  return 2.*dx*dz/distxy;
931 
932  case 27:
933  return 2.*dy*dz/distxy;
934 
935  case 28:
936  case 29:
937  return 0.;
938 
939  case 30:
940  return dz*dz/distxy;
941 
942  case 31:
943  case 32:
944  case 33:
945  case 34:
946  return 0.;
947 
948  default:
949  unsigned int o = 0;
950  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
951  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
952  unsigned int block=o, nz = 0;
953  for (; block < i2; block += (o-nz+1)) { nz++; }
954  const unsigned int nx = block - i2;
955  const unsigned int ny = o - nx - nz;
956  Real val = nx * ny;
957  for (unsigned int index=1; index < nx; index++)
958  val *= dx;
959  for (unsigned int index=1; index < ny; index++)
960  val *= dy;
961  for (unsigned int index=0; index != nz; index++)
962  val *= dz;
963  return val/distxy;
964  }
965  }
966 
967 
968  // d^2()/dy^2
969  case 2:
970  {
971  switch (i)
972  {
973  // constant
974  case 0:
975 
976  // linear
977  case 1:
978  case 2:
979  case 3:
980  return 0.;
981 
982  // quadratic
983  case 4:
984  case 5:
985  return 0.;
986 
987  case 6:
988  return 2./dist2y;
989 
990  case 7:
991  case 8:
992  case 9:
993  return 0.;
994 
995  // cubic
996  case 10:
997  case 11:
998  return 0.;
999 
1000  case 12:
1001  return 2.*dx/dist2y;
1002  case 13:
1003  return 6.*dy/dist2y;
1004 
1005  case 14:
1006  case 15:
1007  return 0.;
1008 
1009  case 16:
1010  return 2.*dz/dist2y;
1011 
1012  case 17:
1013  case 18:
1014  case 19:
1015  return 0.;
1016 
1017  // quartics
1018  case 20:
1019  case 21:
1020  return 0.;
1021 
1022  case 22:
1023  return 2.*dx*dx/dist2y;
1024 
1025  case 23:
1026  return 6.*dx*dy/dist2y;
1027 
1028  case 24:
1029  return 12.*dy*dy/dist2y;
1030 
1031  case 25:
1032  case 26:
1033  return 0.;
1034 
1035  case 27:
1036  return 2.*dx*dz/dist2y;
1037 
1038  case 28:
1039  return 6.*dy*dz/dist2y;
1040 
1041  case 29:
1042  case 30:
1043  return 0.;
1044 
1045  case 31:
1046  return 2.*dz*dz/dist2y;
1047 
1048  case 32:
1049  case 33:
1050  case 34:
1051  return 0.;
1052 
1053  default:
1054  unsigned int o = 0;
1055  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1056  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1057  unsigned int block=o, nz = 0;
1058  for (; block < i2; block += (o-nz+1)) { nz++; }
1059  const unsigned int nx = block - i2;
1060  const unsigned int ny = o - nx - nz;
1061  Real val = ny * (ny - 1);
1062  for (unsigned int index=0; index != nx; index++)
1063  val *= dx;
1064  for (unsigned int index=2; index < ny; index++)
1065  val *= dy;
1066  for (unsigned int index=0; index != nz; index++)
1067  val *= dz;
1068  return val/dist2y;
1069  }
1070  }
1071 
1072 
1073  // d^2()/dxdz
1074  case 3:
1075  {
1076  switch (i)
1077  {
1078  // constant
1079  case 0:
1080 
1081  // linear
1082  case 1:
1083  case 2:
1084  case 3:
1085  return 0.;
1086 
1087  // quadratic
1088  case 4:
1089  case 5:
1090  case 6:
1091  return 0.;
1092 
1093  case 7:
1094  return 1./distxz;
1095 
1096  case 8:
1097  case 9:
1098  return 0.;
1099 
1100  // cubic
1101  case 10:
1102  case 11:
1103  case 12:
1104  case 13:
1105  return 0.;
1106 
1107  case 14:
1108  return 2.*dx/distxz;
1109 
1110  case 15:
1111  return dy/distxz;
1112 
1113  case 16:
1114  return 0.;
1115 
1116  case 17:
1117  return 2.*dz/distxz;
1118 
1119  case 18:
1120  case 19:
1121  return 0.;
1122 
1123  // quartics
1124  case 20:
1125  case 21:
1126  case 22:
1127  case 23:
1128  case 24:
1129  return 0.;
1130 
1131  case 25:
1132  return 3.*dx*dx/distxz;
1133 
1134  case 26:
1135  return 2.*dx*dy/distxz;
1136 
1137  case 27:
1138  return dy*dy/distxz;
1139 
1140  case 28:
1141  return 0.;
1142 
1143  case 29:
1144  return 4.*dx*dz/distxz;
1145 
1146  case 30:
1147  return 2.*dy*dz/distxz;
1148 
1149  case 31:
1150  return 0.;
1151 
1152  case 32:
1153  return 3.*dz*dz/distxz;
1154 
1155  case 33:
1156  case 34:
1157  return 0.;
1158 
1159  default:
1160  unsigned int o = 0;
1161  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1162  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1163  unsigned int block=o, nz = 0;
1164  for (; block < i2; block += (o-nz+1)) { nz++; }
1165  const unsigned int nx = block - i2;
1166  const unsigned int ny = o - nx - nz;
1167  Real val = nx * nz;
1168  for (unsigned int index=1; index < nx; index++)
1169  val *= dx;
1170  for (unsigned int index=0; index != ny; index++)
1171  val *= dy;
1172  for (unsigned int index=1; index < nz; index++)
1173  val *= dz;
1174  return val/distxz;
1175  }
1176  }
1177 
1178  // d^2()/dydz
1179  case 4:
1180  {
1181  switch (i)
1182  {
1183  // constant
1184  case 0:
1185 
1186  // linear
1187  case 1:
1188  case 2:
1189  case 3:
1190  return 0.;
1191 
1192  // quadratic
1193  case 4:
1194  case 5:
1195  case 6:
1196  case 7:
1197  return 0.;
1198 
1199  case 8:
1200  return 1./distyz;
1201 
1202  case 9:
1203  return 0.;
1204 
1205  // cubic
1206  case 10:
1207  case 11:
1208  case 12:
1209  case 13:
1210  case 14:
1211  return 0.;
1212 
1213  case 15:
1214  return dx/distyz;
1215 
1216  case 16:
1217  return 2.*dy/distyz;
1218 
1219  case 17:
1220  return 0.;
1221 
1222  case 18:
1223  return 2.*dz/distyz;
1224 
1225  case 19:
1226  return 0.;
1227 
1228  // quartics
1229  case 20:
1230  case 21:
1231  case 22:
1232  case 23:
1233  case 24:
1234  case 25:
1235  return 0.;
1236 
1237  case 26:
1238  return dx*dx/distyz;
1239 
1240  case 27:
1241  return 2.*dx*dy/distyz;
1242 
1243  case 28:
1244  return 3.*dy*dy/distyz;
1245 
1246  case 29:
1247  return 0.;
1248 
1249  case 30:
1250  return 2.*dx*dz/distyz;
1251 
1252  case 31:
1253  return 4.*dy*dz/distyz;
1254 
1255  case 32:
1256  return 0.;
1257 
1258  case 33:
1259  return 3.*dz*dz/distyz;
1260 
1261  case 34:
1262  return 0.;
1263 
1264  default:
1265  unsigned int o = 0;
1266  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1267  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1268  unsigned int block=o, nz = 0;
1269  for (; block < i2; block += (o-nz+1)) { nz++; }
1270  const unsigned int nx = block - i2;
1271  const unsigned int ny = o - nx - nz;
1272  Real val = ny * nz;
1273  for (unsigned int index=0; index != nx; index++)
1274  val *= dx;
1275  for (unsigned int index=1; index < ny; index++)
1276  val *= dy;
1277  for (unsigned int index=1; index < nz; index++)
1278  val *= dz;
1279  return val/distyz;
1280  }
1281  }
1282 
1283 
1284  // d^2()/dz^2
1285  case 5:
1286  {
1287  switch (i)
1288  {
1289  // constant
1290  case 0:
1291 
1292  // linear
1293  case 1:
1294  case 2:
1295  case 3:
1296  return 0.;
1297 
1298  // quadratic
1299  case 4:
1300  case 5:
1301  case 6:
1302  case 7:
1303  case 8:
1304  return 0.;
1305 
1306  case 9:
1307  return 2./dist2z;
1308 
1309  // cubic
1310  case 10:
1311  case 11:
1312  case 12:
1313  case 13:
1314  case 14:
1315  case 15:
1316  case 16:
1317  return 0.;
1318 
1319  case 17:
1320  return 2.*dx/dist2z;
1321 
1322  case 18:
1323  return 2.*dy/dist2z;
1324 
1325  case 19:
1326  return 6.*dz/dist2z;
1327 
1328  // quartics
1329  case 20:
1330  case 21:
1331  case 22:
1332  case 23:
1333  case 24:
1334  case 25:
1335  case 26:
1336  case 27:
1337  case 28:
1338  return 0.;
1339 
1340  case 29:
1341  return 2.*dx*dx/dist2z;
1342 
1343  case 30:
1344  return 2.*dx*dy/dist2z;
1345 
1346  case 31:
1347  return 2.*dy*dy/dist2z;
1348 
1349  case 32:
1350  return 6.*dx*dz/dist2z;
1351 
1352  case 33:
1353  return 6.*dy*dz/dist2z;
1354 
1355  case 34:
1356  return 12.*dz*dz/dist2z;
1357 
1358  default:
1359  unsigned int o = 0;
1360  for (; i >= (o+1)*(o+2)*(o+3)/6; o++) { }
1361  unsigned int i2 = i - (o*(o+1)*(o+2)/6);
1362  unsigned int block=o, nz = 0;
1363  for (; block < i2; block += (o-nz+1)) { nz++; }
1364  const unsigned int nx = block - i2;
1365  const unsigned int ny = o - nx - nz;
1366  Real val = nz * (nz - 1);
1367  for (unsigned int index=0; index != nx; index++)
1368  val *= dx;
1369  for (unsigned int index=0; index != ny; index++)
1370  val *= dy;
1371  for (unsigned int index=2; index < nz; index++)
1372  val *= dz;
1373  return val/dist2z;
1374  }
1375  }
1376 
1377 
1378  default:
1379  libmesh_error_msg("Invalid j = " << j);
1380  }
1381 
1382 #endif
1383 
1384  libmesh_error_msg("We'll never get here!");
1385  return 0.;
1386 }
double abs(double a)
libmesh_assert(remote_elem)
long double max(long double a, double b)
PetscErrorCode Vec x
double pow(double a, int b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
RealGradient libMesh::FE< 0, LAGRANGE_VEC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 735 of file fe_lagrange_vec.C.

References libMesh::Elem::p_level(), libMesh::Real, libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

738 {
739  Real value = FE<0,LAGRANGE>::shape_second_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
740  return libMesh::RealGradient( value );
741 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
RealGradient libMesh::FE< 1, LAGRANGE_VEC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 757 of file fe_lagrange_vec.C.

References libMesh::Elem::p_level(), libMesh::Real, libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

760 {
761  Real value = FE<1,LAGRANGE>::shape_second_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
762  return libMesh::RealGradient( value );
763 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 3, HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 775 of file fe_hierarchic_shape_3D.C.

780 {
781  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge and face orientation is needed.");
782  return 0.;
783 }
template<>
Real libMesh::FE< 3, L2_HIERARCHIC >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 775 of file fe_l2_hierarchic_shape_3D.C.

780 {
781  libmesh_error_msg("Hierarchic polynomials require the element type \nbecause edge and face orientation is needed.");
782  return 0.;
783 }
template<>
Real libMesh::FE< 3, HIERARCHIC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 788 of file fe_hierarchic_shape_3D.C.

References libMesh::invalid_uint, libMesh::libmesh_assert(), and libMesh::Real.

793 {
794  libmesh_assert(elem);
795 
796  const Real eps = 1.e-6;
797  Point pp, pm;
798  unsigned int prevj = libMesh::invalid_uint;
799 
800  switch (j)
801  {
802  // d^2()/dxi^2
803  case 0:
804  {
805  pp = Point(p(0)+eps, p(1), p(2));
806  pm = Point(p(0)-eps, p(1), p(2));
807  prevj = 0;
808  break;
809  }
810 
811  // d^2()/dxideta
812  case 1:
813  {
814  pp = Point(p(0), p(1)+eps, p(2));
815  pm = Point(p(0), p(1)-eps, p(2));
816  prevj = 0;
817  break;
818  }
819 
820  // d^2()/deta^2
821  case 2:
822  {
823  pp = Point(p(0), p(1)+eps, p(2));
824  pm = Point(p(0), p(1)-eps, p(2));
825  prevj = 1;
826  break;
827  }
828 
829  // d^2()/dxidzeta
830  case 3:
831  {
832  pp = Point(p(0), p(1), p(2)+eps);
833  pm = Point(p(0), p(1), p(2)-eps);
834  prevj = 0;
835  break;
836  }
837 
838  // d^2()/detadzeta
839  case 4:
840  {
841  pp = Point(p(0), p(1), p(2)+eps);
842  pm = Point(p(0), p(1), p(2)-eps);
843  prevj = 1;
844  break;
845  }
846 
847  // d^2()/dzeta^2
848  case 5:
849  {
850  pp = Point(p(0), p(1), p(2)+eps);
851  pm = Point(p(0), p(1), p(2)-eps);
852  prevj = 2;
853  break;
854  }
855  default:
856  libmesh_error_msg("Invalid derivative index j = " << j);
857  }
858 
859  return (FE<3,HIERARCHIC>::shape_deriv(elem, order, i, prevj, pp) -
860  FE<3,HIERARCHIC>::shape_deriv(elem, order, i, prevj, pm))
861  / 2. / eps;
862 }
const unsigned int invalid_uint
Definition: libmesh.h:185
libmesh_assert(remote_elem)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, L2_HIERARCHIC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 788 of file fe_l2_hierarchic_shape_3D.C.

References libMesh::invalid_uint, libMesh::libmesh_assert(), and libMesh::Real.

793 {
794  libmesh_assert(elem);
795 
796  const Real eps = 1.e-6;
797  Point pp, pm;
798  unsigned int prevj = libMesh::invalid_uint;
799 
800  switch (j)
801  {
802  // d^2()/dxi^2
803  case 0:
804  {
805  pp = Point(p(0)+eps, p(1), p(2));
806  pm = Point(p(0)-eps, p(1), p(2));
807  prevj = 0;
808  break;
809  }
810 
811  // d^2()/dxideta
812  case 1:
813  {
814  pp = Point(p(0), p(1)+eps, p(2));
815  pm = Point(p(0), p(1)-eps, p(2));
816  prevj = 0;
817  break;
818  }
819 
820  // d^2()/deta^2
821  case 2:
822  {
823  pp = Point(p(0), p(1)+eps, p(2));
824  pm = Point(p(0), p(1)-eps, p(2));
825  prevj = 1;
826  break;
827  }
828 
829  // d^2()/dxidzeta
830  case 3:
831  {
832  pp = Point(p(0), p(1), p(2)+eps);
833  pm = Point(p(0), p(1), p(2)-eps);
834  prevj = 0;
835  break;
836  }
837 
838  // d^2()/detadzeta
839  case 4:
840  {
841  pp = Point(p(0), p(1), p(2)+eps);
842  pm = Point(p(0), p(1), p(2)-eps);
843  prevj = 1;
844  break;
845  }
846 
847  // d^2()/dzeta^2
848  case 5:
849  {
850  pp = Point(p(0), p(1), p(2)+eps);
851  pm = Point(p(0), p(1), p(2)-eps);
852  prevj = 2;
853  break;
854  }
855  default:
856  libmesh_error_msg("Invalid derivative index j = " << j);
857  }
858 
859  return (FE<3,L2_HIERARCHIC>::shape_deriv(elem, order, i, prevj, pp) -
860  FE<3,L2_HIERARCHIC>::shape_deriv(elem, order, i, prevj, pm))
861  / 2. / eps;
862 }
const unsigned int invalid_uint
Definition: libmesh.h:185
libmesh_assert(remote_elem)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, SUBDIVISION >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 793 of file fe_subdivision_2D.C.

References libMesh::FOURTH, and libMesh::TRI3SUBDIVISION.

798 {
799  switch (order)
800  {
801  case FOURTH:
802  {
803  switch (type)
804  {
805  case TRI3SUBDIVISION:
806  libmesh_assert_less(i, 12);
807  return FESubdivision::regular_shape_second_deriv(i,j,p(0),p(1));
808  default:
809  libmesh_error_msg("ERROR: Unsupported element type!");
810  }
811  }
812  default:
813  libmesh_error_msg("ERROR: Unsupported polynomial order!");
814  }
815 
816  libmesh_error_msg("We'll never get here!");
817  return 0.;
818 }
static Real regular_shape_second_deriv(const unsigned int i, const unsigned int j, const Real v, const Real w)
template<>
RealGradient libMesh::FE< 2, LAGRANGE_VEC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 807 of file fe_lagrange_vec.C.

References libMesh::Elem::p_level(), libMesh::Real, libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

810 {
811  Real value = FE<2,LAGRANGE>::shape_second_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i/2, j, p );
812 
813  switch( i%2 )
814  {
815  case 0:
816  return libMesh::RealGradient( value );
817 
818  case 1:
819  return libMesh::RealGradient( Real(0), value );
820 
821  default:
822  libmesh_error_msg("i%2 must be either 0 or 1!");
823  }
824 
825  //dummy
826  return libMesh::RealGradient();
827 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 2, SUBDIVISION >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 823 of file fe_subdivision_2D.C.

References libMesh::libmesh_assert(), and libMesh::Elem::type().

828 {
829  libmesh_assert(elem);
830  return FE<2,SUBDIVISION>::shape_second_deriv(elem->type(), order, i, j, p);
831 }
libmesh_assert(remote_elem)
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
RealGradient libMesh::FE< 3, LAGRANGE_VEC >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 877 of file fe_lagrange_vec.C.

References libMesh::Elem::p_level(), libMesh::Real, libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

880 {
881  Real value = FE<3,LAGRANGE>::shape_second_deriv( elem->type(), static_cast<Order>(order + elem->p_level()), i/3, j, p );
882 
883  switch( i%3 )
884  {
885  case 0:
886  return libMesh::RealGradient( value );
887 
888  case 1:
889  return libMesh::RealGradient( Real(0), value );
890 
891  case 2:
892  return libMesh::RealGradient( Real(0), Real(0), value );
893 
894  default:
895  libmesh_error_msg("i%3 must be 0, 1, or 2!");
896  }
897 
898  //dummy
899  return libMesh::RealGradient();
900 }
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 2, LAGRANGE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 905 of file fe_lagrange_shape_2D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

910 {
911  libmesh_assert(elem);
912 
913  // call the orientation-independent shape functions
914  return FE<2,LAGRANGE>::shape_second_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
915 }
libmesh_assert(remote_elem)
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 2, L2_LAGRANGE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 911 of file fe_l2_lagrange_shape_2D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

916 {
917  libmesh_assert(elem);
918 
919  // call the orientation-independent shape functions
920  return FE<2,L2_LAGRANGE>::shape_second_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
921 }
libmesh_assert(remote_elem)
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 3, L2_LAGRANGE >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 1216 of file fe_l2_lagrange_shape_3D.C.

References libMesh::EDGE3, libMesh::err, libMesh::FIRST, libMesh::HEX20, libMesh::HEX27, libMesh::PRISM18, libMesh::Real, libMesh::SECOND, libMesh::TET10, and libMesh::TRI6.

1221 {
1222 #if LIBMESH_DIM == 3
1223 
1224  libmesh_assert_less (j, 6);
1225 
1226  switch (order)
1227  {
1228  // linear Lagrange shape functions
1229  case FIRST:
1230  {
1231  return 0.;
1232  }
1233 
1234  // quadratic Lagrange shape functions
1235  case SECOND:
1236  {
1237  switch (type)
1238  {
1239 
1240  // serendipity hexahedral quadratic shape functions
1241  case HEX20:
1242  {
1243  static bool warning_given_HEX20 = false;
1244 
1245  if (!warning_given_HEX20)
1246  libMesh::err << "Second derivatives for 3D Lagrangian HEX20"
1247  << " elements are not yet implemented!"
1248  << std::endl;
1249  warning_given_HEX20 = true;
1250  }
1251 
1252  // triquadraic hexahedral shape funcions
1253  case HEX27:
1254  {
1255  libmesh_assert_less (i, 27);
1256 
1257  // Compute hex shape functions as a tensor-product
1258  const Real xi = p(0);
1259  const Real eta = p(1);
1260  const Real zeta = p(2);
1261 
1262  // The only way to make any sense of this
1263  // is to look at the mgflo/mg2/mgf documentation
1264  // and make the cut-out cube!
1265  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
1266  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
1267  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
1268  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
1269 
1270  switch(j)
1271  {
1272  // d^2()/dxi^2
1273  case 0:
1274  return (FE<1,L2_LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i0[i], 0, xi)*
1275  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
1276  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
1277 
1278  // d^2()/dxideta
1279  case 1:
1280  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
1281  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta)*
1282  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
1283 
1284  // d^2()/deta^2
1285  case 2:
1286  return (FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
1287  FE<1,L2_LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i1[i], 0, eta)*
1288  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
1289 
1290  // d^2()/dxidzeta
1291  case 3:
1292  return (FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
1293  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
1294  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i2[i], 0, zeta));
1295 
1296  // d^2()/detadzeta
1297  case 4:
1298  return (FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
1299  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta)*
1300  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i2[i], 0, zeta));
1301 
1302  // d^2()/dzeta^2
1303  case 5:
1304  return (FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
1305  FE<1,L2_LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
1306  FE<1,L2_LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i2[i], 0, zeta));
1307 
1308  default:
1309  libmesh_error_msg("Invalid j = " << j);
1310  }
1311  }
1312 
1313  // quadratic tetrahedral shape functions
1314  case TET10:
1315  {
1316  // The area coordinates are the same as used for the
1317  // shape() and shape_deriv() functions.
1318  // const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
1319  // const Real zeta1 = p(0);
1320  // const Real zeta2 = p(1);
1321  // const Real zeta3 = p(2);
1322  static const Real dzetadxi[4][3] =
1323  {
1324  {-1., -1., -1.},
1325  {1., 0., 0.},
1326  {0., 1., 0.},
1327  {0., 0., 1.}
1328  };
1329 
1330  // Convert from j -> (j,k) indices for independent variable
1331  // (0=xi, 1=eta, 2=zeta)
1332  static const unsigned short int independent_var_indices[6][2] =
1333  {
1334  {0, 0}, // d^2 phi / dxi^2
1335  {0, 1}, // d^2 phi / dxi deta
1336  {1, 1}, // d^2 phi / deta^2
1337  {0, 2}, // d^2 phi / dxi dzeta
1338  {1, 2}, // d^2 phi / deta dzeta
1339  {2, 2} // d^2 phi / dzeta^2
1340  };
1341 
1342  // Convert from i -> zeta indices. Each quadratic shape
1343  // function for the Tet10 depends on up to two of the zeta
1344  // area coordinate functions (see the shape() function above).
1345  // This table just tells which two area coords it uses.
1346  static const unsigned short int zeta_indices[10][2] =
1347  {
1348  {0, 0},
1349  {1, 1},
1350  {2, 2},
1351  {3, 3},
1352  {0, 1},
1353  {1, 2},
1354  {2, 0},
1355  {0, 3},
1356  {1, 3},
1357  {2, 3},
1358  };
1359 
1360  // Look up the independent variable indices for this value of j.
1361  const unsigned int my_j = independent_var_indices[j][0];
1362  const unsigned int my_k = independent_var_indices[j][1];
1363 
1364  if (i<4)
1365  {
1366  return 4.*dzetadxi[i][my_j]*dzetadxi[i][my_k];
1367  }
1368 
1369  else if (i<10)
1370  {
1371  const unsigned short int my_m = zeta_indices[i][0];
1372  const unsigned short int my_n = zeta_indices[i][1];
1373 
1374  return 4.*(dzetadxi[my_n][my_j]*dzetadxi[my_m][my_k] +
1375  dzetadxi[my_m][my_j]*dzetadxi[my_n][my_k] );
1376  }
1377  else
1378  libmesh_error_msg("Invalid shape function index " << i);
1379  }
1380 
1381 
1382  // quadradic prism shape functions
1383  case PRISM18:
1384  {
1385  libmesh_assert_less (i, 18);
1386 
1387  // Compute prism shape functions as a tensor-product
1388  // of a triangle and an edge
1389 
1390  Point p2d(p(0),p(1));
1391  Point p1d(p(2));
1392 
1393  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
1394  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2};
1395  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 3, 4, 5};
1396 
1397  switch (j)
1398  {
1399  // d^2()/dxi^2
1400  case 0:
1401  return (FE<2,L2_LAGRANGE>::shape_second_deriv(TRI6, SECOND, i1[i], 0, p2d)*
1402  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
1403 
1404  // d^2()/dxideta
1405  case 1:
1406  return (FE<2,L2_LAGRANGE>::shape_second_deriv(TRI6, SECOND, i1[i], 1, p2d)*
1407  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
1408 
1409  // d^2()/deta^2
1410  case 2:
1411  return (FE<2,L2_LAGRANGE>::shape_second_deriv(TRI6, SECOND, i1[i], 2, p2d)*
1412  FE<1,L2_LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
1413 
1414  // d^2()/dxidzeta
1415  case 3:
1416  return (FE<2,L2_LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 0, p2d)*
1417  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, p1d));
1418 
1419  // d^2()/detadzeta
1420  case 4:
1421  return (FE<2,L2_LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 1, p2d)*
1422  FE<1,L2_LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, p1d));
1423 
1424  // d^2()/dzeta^2
1425  case 5:
1426  return (FE<2,L2_LAGRANGE>::shape(TRI6, SECOND, i1[i], p2d)*
1427  FE<1,L2_LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i0[i], 0, p1d));
1428 
1429  default:
1430  libmesh_error_msg("Invalid shape function derivative j = " << j);
1431  }
1432  }
1433 
1434 
1435 
1436  default:
1437  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
1438  }
1439  }
1440 
1441 
1442  // unsupported order
1443  default:
1444  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << order);
1445  }
1446 
1447 #endif
1448 
1449  libmesh_error_msg("We'll never get here!");
1450  return 0.;
1451 }
OStreamProxy err(std::cerr)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 3, MONOMIAL >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 1304 of file fe_monomial_shape_3D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

1309 {
1310  libmesh_assert(elem);
1311 
1312  // call the orientation-independent shape function derivatives
1313  return FE<3,MONOMIAL>::shape_second_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
1314 }
libmesh_assert(remote_elem)
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 2, SZABAB >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 1406 of file fe_szabab_shape_2D.C.

References libMesh::err.

1411 {
1412  static bool warning_given = false;
1413 
1414  if (!warning_given)
1415  libMesh::err << "Second derivatives for Szabab elements "
1416  << " are not yet implemented!"
1417  << std::endl;
1418 
1419  warning_given = true;
1420  return 0.;
1421 }
OStreamProxy err(std::cerr)
template<>
Real libMesh::FE< 2, SZABAB >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 1426 of file fe_szabab_shape_2D.C.

References libMesh::err.

1431 {
1432  static bool warning_given = false;
1433 
1434  if (!warning_given)
1435  libMesh::err << "Second derivatives for Szabab elements "
1436  << " are not yet implemented!"
1437  << std::endl;
1438 
1439  warning_given = true;
1440  return 0.;
1441 }
OStreamProxy err(std::cerr)
template<>
Real libMesh::FE< 3, L2_LAGRANGE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 1456 of file fe_l2_lagrange_shape_3D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

1461 {
1462  libmesh_assert(elem);
1463 
1464  // call the orientation-independent shape function derivatives
1465  return FE<3,L2_LAGRANGE>::shape_second_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
1466 }
libmesh_assert(remote_elem)
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
Real libMesh::FE< 3, LAGRANGE >::shape_second_deriv ( const ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 1931 of file fe_lagrange_shape_3D.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::FIRST, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::Real, libMesh::SECOND, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, and libMesh::x.

1936 {
1937 #if LIBMESH_DIM == 3
1938 
1939  libmesh_assert_less (j, 6);
1940 
1941  switch (order)
1942  {
1943  // linear Lagrange shape functions
1944  case FIRST:
1945  {
1946  switch (type)
1947  {
1948  // Linear tets have all second derivatives = 0
1949  case TET4:
1950  case TET10:
1951  {
1952  return 0.;
1953  }
1954 
1955  // The following elements use either tensor product or
1956  // rational basis functions, and therefore probably have
1957  // second derivatives, but we have not implemented them
1958  // yet...
1959  case PRISM6:
1960  case PRISM15:
1961  case PRISM18:
1962  {
1963  libmesh_assert_less (i, 6);
1964 
1965  // Compute prism shape functions as a tensor-product
1966  // of a triangle and an edge
1967 
1968  Point p2d(p(0),p(1));
1969  Point p1d(p(2));
1970 
1971  // 0 1 2 3 4 5
1972  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1};
1973  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2};
1974 
1975  switch (j)
1976  {
1977  // All repeated second derivatives and the xi-eta derivative are zero on PRISMs
1978  case 0: // d^2()/dxi^2
1979  case 1: // d^2()/dxideta
1980  case 2: // d^2()/deta^2
1981  case 5: // d^2()/dzeta^2
1982  {
1983  return 0.;
1984  }
1985 
1986  case 3: // d^2()/dxidzeta
1987  return (FE<2,LAGRANGE>::shape_deriv(TRI3, FIRST, i1[i], 0, p2d)*
1988  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, p1d));
1989 
1990  case 4: // d^2()/detadzeta
1991  return (FE<2,LAGRANGE>::shape_deriv(TRI3, FIRST, i1[i], 1, p2d)*
1992  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, p1d));
1993 
1994  default:
1995  libmesh_error_msg("Invalid j = " << j);
1996  }
1997  }
1998 
1999  case PYRAMID5:
2000  case PYRAMID13:
2001  case PYRAMID14:
2002  {
2003  libmesh_assert_less (i, 5);
2004 
2005  const Real xi = p(0);
2006  const Real eta = p(1);
2007  const Real zeta = p(2);
2008  const Real eps = 1.e-35;
2009 
2010  switch (j)
2011  {
2012  // xi-xi and eta-eta derivatives are all zero for PYRAMID5.
2013  case 0: // d^2()/dxi^2
2014  case 2: // d^2()/deta^2
2015  return 0.;
2016 
2017  case 1: // d^2()/dxideta
2018  {
2019  switch (i)
2020  {
2021  case 0:
2022  case 2:
2023  return 0.25/(1. - zeta + eps);
2024  case 1:
2025  case 3:
2026  return -0.25/(1. - zeta + eps);
2027  case 4:
2028  return 0.;
2029  default:
2030  libmesh_error_msg("Invalid i = " << i);
2031  }
2032  }
2033 
2034  case 3: // d^2()/dxidzeta
2035  {
2036  Real den = (1. - zeta + eps)*(1. - zeta + eps);
2037 
2038  switch (i)
2039  {
2040  case 0:
2041  case 2:
2042  return 0.25*eta/den;
2043  case 1:
2044  case 3:
2045  return -0.25*eta/den;
2046  case 4:
2047  return 0.;
2048  default:
2049  libmesh_error_msg("Invalid i = " << i);
2050  }
2051  }
2052 
2053  case 4: // d^2()/detadzeta
2054  {
2055  Real den = (1. - zeta + eps)*(1. - zeta + eps);
2056 
2057  switch (i)
2058  {
2059  case 0:
2060  case 2:
2061  return 0.25*xi/den;
2062  case 1:
2063  case 3:
2064  return -0.25*xi/den;
2065  case 4:
2066  return 0.;
2067  default:
2068  libmesh_error_msg("Invalid i = " << i);
2069  }
2070  }
2071 
2072  case 5: // d^2()/dzeta^2
2073  {
2074  Real den = (1. - zeta + eps)*(1. - zeta + eps)*(1. - zeta + eps);
2075 
2076  switch (i)
2077  {
2078  case 0:
2079  case 2:
2080  return 0.5*xi*eta/den;
2081  case 1:
2082  case 3:
2083  return -0.5*xi*eta/den;
2084  case 4:
2085  return 0.;
2086  default:
2087  libmesh_error_msg("Invalid i = " << i);
2088  }
2089  }
2090 
2091  default:
2092  libmesh_error_msg("Invalid j = " << j);
2093  }
2094  }
2095 
2096  // Trilinear shape functions on HEX8s have nonzero mixed second derivatives
2097  case HEX8:
2098  case HEX20:
2099  case HEX27:
2100  {
2101  libmesh_assert_less (i, 8);
2102 
2103  // Compute hex shape functions as a tensor-product
2104  const Real xi = p(0);
2105  const Real eta = p(1);
2106  const Real zeta = p(2);
2107 
2108  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0};
2109  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1};
2110  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1};
2111 
2112  switch (j)
2113  {
2114  // All repeated second derivatives are zero on HEX8
2115  case 0: // d^2()/dxi^2
2116  case 2: // d^2()/deta^2
2117  case 5: // d^2()/dzeta^2
2118  {
2119  return 0.;
2120  }
2121 
2122  case 1: // d^2()/dxideta
2123  return (FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
2124  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta)*
2125  FE<1,LAGRANGE>::shape (EDGE2, FIRST, i2[i], zeta));
2126 
2127  case 3: // d^2()/dxidzeta
2128  return (FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i0[i], 0, xi)*
2129  FE<1,LAGRANGE>::shape (EDGE2, FIRST, i1[i], eta)*
2130  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i2[i], 0, zeta));
2131 
2132  case 4: // d^2()/detadzeta
2133  return (FE<1,LAGRANGE>::shape (EDGE2, FIRST, i0[i], xi)*
2134  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i1[i], 0, eta)*
2135  FE<1,LAGRANGE>::shape_deriv(EDGE2, FIRST, i2[i], 0, zeta));
2136 
2137  default:
2138  libmesh_error_msg("Invalid j = " << j);
2139  }
2140  }
2141 
2142  default:
2143  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
2144  }
2145 
2146  }
2147 
2148  // quadratic Lagrange shape functions
2149  case SECOND:
2150  {
2151  switch (type)
2152  {
2153 
2154  // serendipity hexahedral quadratic shape functions
2155  case HEX20:
2156  {
2157  libmesh_assert_less (i, 20);
2158 
2159  const Real xi = p(0);
2160  const Real eta = p(1);
2161  const Real zeta = p(2);
2162 
2163  // these functions are defined for (x,y,z) in [0,1]^3
2164  // so transform the locations
2165  const Real x = .5*(xi + 1.);
2166  const Real y = .5*(eta + 1.);
2167  const Real z = .5*(zeta + 1.);
2168 
2169  switch(j)
2170  {
2171  case 0: // d^2()/dxi^2
2172  {
2173  switch(i)
2174  {
2175  case 0:
2176  case 1:
2177  return (1. - y) * (1. - z);
2178  case 2:
2179  case 3:
2180  return y * (1. - z);
2181  case 4:
2182  case 5:
2183  return (1. - y) * z;
2184  case 6:
2185  case 7:
2186  return y * z;
2187  case 8:
2188  return -2. * (1. - y) * (1. - z);
2189  case 10:
2190  return -2. * y * (1. - z);
2191  case 16:
2192  return -2. * (1. - y) * z;
2193  case 18:
2194  return -2. * y * z;
2195  case 9:
2196  case 11:
2197  case 12:
2198  case 13:
2199  case 14:
2200  case 15:
2201  case 17:
2202  case 19:
2203  return 0;
2204  default:
2205  libmesh_error_msg("Invalid i = " << i);
2206  }
2207  }
2208  case 1: // d^2()/dxideta
2209  {
2210  switch(i)
2211  {
2212  case 0:
2213  return (1.25 - x - y - .5*z) * (1. - z);
2214  case 1:
2215  return (-x + y + .5*z - .25) * (1. - z);
2216  case 2:
2217  return (x + y - .5*z - .75) * (1. - z);
2218  case 3:
2219  return (-y + x + .5*z - .25) * (1. - z);
2220  case 4:
2221  return -.25*z * (4.*x + 4.*y - 2.*z - 3);
2222  case 5:
2223  return -.25*z * (-4.*y + 4.*x + 2.*z - 1.);
2224  case 6:
2225  return .25*z * (-5 + 4.*x + 4.*y + 2.*z);
2226  case 7:
2227  return .25*z * (4.*x - 4.*y - 2.*z + 1.);
2228  case 8:
2229  return (-1. + 2.*x) * (1. - z);
2230  case 9:
2231  return (1. - 2.*y) * (1. - z);
2232  case 10:
2233  return (1. - 2.*x) * (1. - z);
2234  case 11:
2235  return (-1. + 2.*y) * (1. - z);
2236  case 12:
2237  return z * (1. - z);
2238  case 13:
2239  return -z * (1. - z);
2240  case 14:
2241  return z * (1. - z);
2242  case 15:
2243  return -z * (1. - z);
2244  case 16:
2245  return (-1. + 2.*x) * z;
2246  case 17:
2247  return (1. - 2.*y) * z;
2248  case 18:
2249  return (1. - 2.*x) * z;
2250  case 19:
2251  return (-1. + 2.*y) * z;
2252  default:
2253  libmesh_error_msg("Invalid i = " << i);
2254  }
2255  }
2256  case 2: // d^2()/deta^2
2257  switch(i)
2258  {
2259  case 0:
2260  case 3:
2261  return (1. - x) * (1. - z);
2262  case 1:
2263  case 2:
2264  return x * (1. - z);
2265  case 4:
2266  case 7:
2267  return (1. - x) * z;
2268  case 5:
2269  case 6:
2270  return x * z;
2271  case 9:
2272  return -2. * x * (1. - z);
2273  case 11:
2274  return -2. * (1. - x) * (1. - z);
2275  case 17:
2276  return -2. * x * z;
2277  case 19:
2278  return -2. * (1. - x) * z;
2279  case 8:
2280  case 10:
2281  case 12:
2282  case 13:
2283  case 14:
2284  case 15:
2285  case 16:
2286  case 18:
2287  return 0.;
2288  default:
2289  libmesh_error_msg("Invalid i = " << i);
2290  }
2291  case 3: // d^2()/dxidzeta
2292  switch(i)
2293  {
2294  case 0:
2295  return (1.25 - x - .5*y - z) * (1. - y);
2296  case 1:
2297  return (-x + .5*y + z - .25) * (1. - y);
2298  case 2:
2299  return -.25*y * (2.*y + 4.*x - 4.*z - 1.);
2300  case 3:
2301  return -.25*y * (-2.*y + 4.*x + 4.*z - 3);
2302  case 4:
2303  return (-z + x + .5*y - .25) * (1. - y);
2304  case 5:
2305  return (x - .5*y + z - .75) * (1. - y);
2306  case 6:
2307  return .25*y * (2.*y + 4.*x + 4.*z - 5);
2308  case 7:
2309  return .25*y * (-2.*y + 4.*x - 4.*z + 1.);
2310  case 8:
2311  return (-1. + 2.*x) * (1. - y);
2312  case 9:
2313  return -y * (1. - y);
2314  case 10:
2315  return (-1. + 2.*x) * y;
2316  case 11:
2317  return y * (1. - y);
2318  case 12:
2319  return (-1. + 2.*z) * (1. - y);
2320  case 13:
2321  return (1. - 2.*z) * (1. - y);
2322  case 14:
2323  return (1. - 2.*z) * y;
2324  case 15:
2325  return (-1. + 2.*z) * y;
2326  case 16:
2327  return (1. - 2.*x) * (1. - y);
2328  case 17:
2329  return y * (1. - y);
2330  case 18:
2331  return (1. - 2.*x) * y;
2332  case 19:
2333  return -y * (1. - y);
2334  default:
2335  libmesh_error_msg("Invalid i = " << i);
2336  }
2337  case 4: // d^2()/detadzeta
2338  switch(i)
2339  {
2340  case 0:
2341  return (1.25 - .5*x - y - z) * (1. - x);
2342  case 1:
2343  return .25*x * (2.*x - 4.*y - 4.*z + 3.);
2344  case 2:
2345  return -.25*x * (2.*x + 4.*y - 4.*z - 1.);
2346  case 3:
2347  return (-y + .5*x + z - .25) * (1. - x);
2348  case 4:
2349  return (-z + .5*x + y - .25) * (1. - x);
2350  case 5:
2351  return -.25*x * (2.*x - 4.*y + 4.*z - 1.);
2352  case 6:
2353  return .25*x * (2.*x + 4.*y + 4.*z - 5);
2354  case 7:
2355  return (y - .5*x + z - .75) * (1. - x);
2356  case 8:
2357  return x * (1. - x);
2358  case 9:
2359  return (-1. + 2.*y) * x;
2360  case 10:
2361  return -x * (1. - x);
2362  case 11:
2363  return (-1. + 2.*y) * (1. - x);
2364  case 12:
2365  return (-1. + 2.*z) * (1. - x);
2366  case 13:
2367  return (-1. + 2.*z) * x;
2368  case 14:
2369  return (1. - 2.*z) * x;
2370  case 15:
2371  return (1. - 2.*z) * (1. - x);
2372  case 16:
2373  return -x * (1. - x);
2374  case 17:
2375  return (1. - 2.*y) * x;
2376  case 18:
2377  return x * (1. - x);
2378  case 19:
2379  return (1. - 2.*y) * (1. - x);
2380  default:
2381  libmesh_error_msg("Invalid i = " << i);
2382  }
2383  case 5: // d^2()/dzeta^2
2384  switch(i)
2385  {
2386  case 0:
2387  case 4:
2388  return (1. - x) * (1. - y);
2389  case 1:
2390  case 5:
2391  return x * (1. - y);
2392  case 2:
2393  case 6:
2394  return x * y;
2395  case 3:
2396  case 7:
2397  return (1. - x) * y;
2398  case 12:
2399  return -2. * (1. - x) * (1. - y);
2400  case 13:
2401  return -2. * x * (1. - y);
2402  case 14:
2403  return -2. * x * y;
2404  case 15:
2405  return -2. * (1. - x) * y;
2406  case 8:
2407  case 9:
2408  case 10:
2409  case 11:
2410  case 16:
2411  case 17:
2412  case 18:
2413  case 19:
2414  return 0.;
2415  default:
2416  libmesh_error_msg("Invalid i = " << i);
2417  }
2418  default:
2419  libmesh_error_msg("Invalid j = " << j);
2420  }
2421  }
2422 
2423  // triquadraic hexahedral shape funcions
2424  case HEX27:
2425  {
2426  libmesh_assert_less (i, 27);
2427 
2428  // Compute hex shape functions as a tensor-product
2429  const Real xi = p(0);
2430  const Real eta = p(1);
2431  const Real zeta = p(2);
2432 
2433  // The only way to make any sense of this
2434  // is to look at the mgflo/mg2/mgf documentation
2435  // and make the cut-out cube!
2436  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
2437  static const unsigned int i0[] = {0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 0, 2, 2, 1, 2, 0, 2, 2};
2438  static const unsigned int i1[] = {0, 0, 1, 1, 0, 0, 1, 1, 0, 2, 1, 2, 0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 2, 1, 2, 2, 2};
2439  static const unsigned int i2[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1, 0, 2, 2, 2, 2, 1, 2};
2440 
2441  switch(j)
2442  {
2443  // d^2()/dxi^2
2444  case 0:
2445  return (FE<1,LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i0[i], 0, xi)*
2446  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
2447  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
2448 
2449  // d^2()/dxideta
2450  case 1:
2451  return (FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
2452  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta)*
2453  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
2454 
2455  // d^2()/deta^2
2456  case 2:
2457  return (FE<1,LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
2458  FE<1,LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i1[i], 0, eta)*
2459  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i2[i], zeta));
2460 
2461  // d^2()/dxidzeta
2462  case 3:
2463  return (FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, xi)*
2464  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
2465  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i2[i], 0, zeta));
2466 
2467  // d^2()/detadzeta
2468  case 4:
2469  return (FE<1,LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
2470  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i1[i], 0, eta)*
2471  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i2[i], 0, zeta));
2472 
2473  // d^2()/dzeta^2
2474  case 5:
2475  return (FE<1,LAGRANGE>::shape (EDGE3, SECOND, i0[i], xi)*
2476  FE<1,LAGRANGE>::shape (EDGE3, SECOND, i1[i], eta)*
2477  FE<1,LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i2[i], 0, zeta));
2478 
2479  default:
2480  libmesh_error_msg("Invalid j = " << j);
2481  }
2482  }
2483 
2484  // quadratic tetrahedral shape functions
2485  case TET10:
2486  {
2487  // The area coordinates are the same as used for the
2488  // shape() and shape_deriv() functions.
2489  // const Real zeta0 = 1. - zeta1 - zeta2 - zeta3;
2490  // const Real zeta1 = p(0);
2491  // const Real zeta2 = p(1);
2492  // const Real zeta3 = p(2);
2493  static const Real dzetadxi[4][3] =
2494  {
2495  {-1., -1., -1.},
2496  {1., 0., 0.},
2497  {0., 1., 0.},
2498  {0., 0., 1.}
2499  };
2500 
2501  // Convert from j -> (j,k) indices for independent variable
2502  // (0=xi, 1=eta, 2=zeta)
2503  static const unsigned short int independent_var_indices[6][2] =
2504  {
2505  {0, 0}, // d^2 phi / dxi^2
2506  {0, 1}, // d^2 phi / dxi deta
2507  {1, 1}, // d^2 phi / deta^2
2508  {0, 2}, // d^2 phi / dxi dzeta
2509  {1, 2}, // d^2 phi / deta dzeta
2510  {2, 2} // d^2 phi / dzeta^2
2511  };
2512 
2513  // Convert from i -> zeta indices. Each quadratic shape
2514  // function for the Tet10 depends on up to two of the zeta
2515  // area coordinate functions (see the shape() function above).
2516  // This table just tells which two area coords it uses.
2517  static const unsigned short int zeta_indices[10][2] =
2518  {
2519  {0, 0},
2520  {1, 1},
2521  {2, 2},
2522  {3, 3},
2523  {0, 1},
2524  {1, 2},
2525  {2, 0},
2526  {0, 3},
2527  {1, 3},
2528  {2, 3},
2529  };
2530 
2531  // Look up the independent variable indices for this value of j.
2532  const unsigned int my_j = independent_var_indices[j][0];
2533  const unsigned int my_k = independent_var_indices[j][1];
2534 
2535  if (i<4)
2536  {
2537  return 4.*dzetadxi[i][my_j]*dzetadxi[i][my_k];
2538  }
2539 
2540  else if (i<10)
2541  {
2542  const unsigned short int my_m = zeta_indices[i][0];
2543  const unsigned short int my_n = zeta_indices[i][1];
2544 
2545  return 4.*(dzetadxi[my_n][my_j]*dzetadxi[my_m][my_k] +
2546  dzetadxi[my_m][my_j]*dzetadxi[my_n][my_k] );
2547  }
2548  else
2549  libmesh_error_msg("Invalid shape function index " << i);
2550  }
2551 
2552 
2553 
2554  // "serendipity" prism
2555  case PRISM15:
2556  {
2557  libmesh_assert_less (i, 15);
2558 
2559  const Real xi = p(0);
2560  const Real eta = p(1);
2561  const Real zeta = p(2);
2562 
2563  switch (j)
2564  {
2565  // d^2()/dxi^2
2566  case 0:
2567  {
2568  switch(i)
2569  {
2570  case 0:
2571  case 1:
2572  return 2.*(1. - zeta);
2573  case 2:
2574  case 5:
2575  case 7:
2576  case 8:
2577  case 9:
2578  case 10:
2579  case 11:
2580  case 13:
2581  case 14:
2582  return 0.;
2583  case 3:
2584  case 4:
2585  return 2.*(1. + zeta);
2586  case 6:
2587  return 4.*(zeta - 1);
2588  case 12:
2589  return -4.*(1. + zeta);
2590  default:
2591  libmesh_error_msg("Invalid i = " << i);
2592  }
2593  }
2594 
2595  // d^2()/dxideta
2596  case 1:
2597  {
2598  switch(i)
2599  {
2600  case 0:
2601  case 7:
2602  return 2.*(1. - zeta);
2603  case 1:
2604  case 2:
2605  case 4:
2606  case 5:
2607  case 9:
2608  case 10:
2609  case 11:
2610  return 0.;
2611  case 3:
2612  case 13:
2613  return 2.*(1. + zeta);
2614  case 6:
2615  case 8:
2616  return 2.*(zeta - 1.);
2617  case 12:
2618  case 14:
2619  return -2.*(1. + zeta);
2620  default:
2621  libmesh_error_msg("Invalid i = " << i);
2622  }
2623  }
2624 
2625  // d^2()/deta^2
2626  case 2:
2627  {
2628  switch(i)
2629  {
2630  case 0:
2631  case 2:
2632  return 2.*(1. - zeta);
2633  case 1:
2634  case 4:
2635  case 6:
2636  case 7:
2637  case 9:
2638  case 10:
2639  case 11:
2640  case 12:
2641  case 13:
2642  return 0.;
2643  case 3:
2644  case 5:
2645  return 2.*(1. + zeta);
2646  case 8:
2647  return 4.*(zeta - 1.);
2648  case 14:
2649  return -4.*(1. + zeta);
2650  default:
2651  libmesh_error_msg("Invalid i = " << i);
2652  }
2653  }
2654 
2655  // d^2()/dxidzeta
2656  case 3:
2657  {
2658  switch(i)
2659  {
2660  case 0:
2661  return 1.5 - zeta - 2.*xi - 2.*eta;
2662  case 1:
2663  return 0.5 + zeta - 2.*xi;
2664  case 2:
2665  case 5:
2666  case 11:
2667  return 0.;
2668  case 3:
2669  return -1.5 - zeta + 2.*xi + 2.*eta;
2670  case 4:
2671  return -0.5 + zeta + 2.*xi;
2672  case 6:
2673  return 4.*xi + 2.*eta - 2.;
2674  case 7:
2675  return -2.*eta;
2676  case 8:
2677  return 2.*eta;
2678  case 9:
2679  return 2.*zeta;
2680  case 10:
2681  return -2.*zeta;
2682  case 12:
2683  return -4.*xi - 2.*eta + 2.;
2684  case 13:
2685  return 2.*eta;
2686  case 14:
2687  return -2.*eta;
2688  default:
2689  libmesh_error_msg("Invalid i = " << i);
2690  }
2691  }
2692 
2693  // d^2()/detadzeta
2694  case 4:
2695  {
2696  switch(i)
2697  {
2698  case 0:
2699  return 1.5 - zeta - 2.*xi - 2.*eta;
2700  case 1:
2701  case 4:
2702  case 10:
2703  return 0.;
2704  case 2:
2705  return .5 + zeta - 2.*eta;
2706  case 3:
2707  return -1.5 - zeta + 2.*xi + 2.*eta;
2708  case 5:
2709  return -.5 + zeta + 2.*eta;
2710  case 6:
2711  return 2.*xi;
2712  case 7:
2713  return -2.*xi;
2714  case 8:
2715  return 2.*xi + 4.*eta - 2.;
2716  case 9:
2717  return 2.*zeta;
2718  case 11:
2719  return -2.*zeta;
2720  case 12:
2721  return -2.*xi;
2722  case 13:
2723  return 2.*xi;
2724  case 14:
2725  return -2.*xi - 4.*eta + 2.;
2726  default:
2727  libmesh_error_msg("Invalid i = " << i);
2728  }
2729  }
2730 
2731  // d^2()/dzeta^2
2732  case 5:
2733  {
2734  switch(i)
2735  {
2736  case 0:
2737  case 3:
2738  return 1. - xi - eta;
2739  case 1:
2740  case 4:
2741  return xi;
2742  case 2:
2743  case 5:
2744  return eta;
2745  case 6:
2746  case 7:
2747  case 8:
2748  case 12:
2749  case 13:
2750  case 14:
2751  return 0.;
2752  case 9:
2753  return 2.*xi + 2.*eta - 2.;
2754  case 10:
2755  return -2.*xi;
2756  case 11:
2757  return -2.*eta;
2758  default:
2759  libmesh_error_msg("Invalid i = " << i);
2760  }
2761  }
2762 
2763  default:
2764  libmesh_error_msg("Invalid j = " << j);
2765  }
2766  }
2767 
2768 
2769 
2770  // quadradic prism shape functions
2771  case PRISM18:
2772  {
2773  libmesh_assert_less (i, 18);
2774 
2775  // Compute prism shape functions as a tensor-product
2776  // of a triangle and an edge
2777 
2778  Point p2d(p(0),p(1));
2779  Point p1d(p(2));
2780 
2781  // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
2782  static const unsigned int i0[] = {0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1, 1, 2, 2, 2};
2783  static const unsigned int i1[] = {0, 1, 2, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 3, 4, 5};
2784 
2785  switch (j)
2786  {
2787  // d^2()/dxi^2
2788  case 0:
2789  return (FE<2,LAGRANGE>::shape_second_deriv(TRI6, SECOND, i1[i], 0, p2d)*
2790  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
2791 
2792  // d^2()/dxideta
2793  case 1:
2794  return (FE<2,LAGRANGE>::shape_second_deriv(TRI6, SECOND, i1[i], 1, p2d)*
2795  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
2796 
2797  // d^2()/deta^2
2798  case 2:
2799  return (FE<2,LAGRANGE>::shape_second_deriv(TRI6, SECOND, i1[i], 2, p2d)*
2800  FE<1,LAGRANGE>::shape(EDGE3, SECOND, i0[i], p1d));
2801 
2802  // d^2()/dxidzeta
2803  case 3:
2804  return (FE<2,LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 0, p2d)*
2805  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, p1d));
2806 
2807  // d^2()/detadzeta
2808  case 4:
2809  return (FE<2,LAGRANGE>::shape_deriv(TRI6, SECOND, i1[i], 1, p2d)*
2810  FE<1,LAGRANGE>::shape_deriv(EDGE3, SECOND, i0[i], 0, p1d));
2811 
2812  // d^2()/dzeta^2
2813  case 5:
2814  return (FE<2,LAGRANGE>::shape(TRI6, SECOND, i1[i], p2d)*
2815  FE<1,LAGRANGE>::shape_second_deriv(EDGE3, SECOND, i0[i], 0, p1d));
2816 
2817  default:
2818  libmesh_error_msg("Invalid shape function derivative j = " << j);
2819  }
2820  }
2821 
2822 
2823  // Quadratic shape functions, as defined in R. Graglia, "Higher order
2824  // bases on pyramidal elements", IEEE Trans Antennas and Propagation,
2825  // vol 47, no 5, May 1999.
2826  case PYRAMID14:
2827  {
2828  libmesh_assert_less (i, 14);
2829 
2830  const Real xi = p(0);
2831  const Real eta = p(1);
2832  const Real zeta = p(2);
2833  const Real eps = 1.e-35;
2834 
2835  // The "normalized coordinates" defined by Graglia. These are
2836  // the planes which define the faces of the pyramid.
2837  Real
2838  p1 = 0.5*(1. - eta - zeta), // back
2839  p2 = 0.5*(1. + xi - zeta), // left
2840  p3 = 0.5*(1. + eta - zeta), // front
2841  p4 = 0.5*(1. - xi - zeta); // right
2842 
2843  // Denominators are perturbed by epsilon to avoid
2844  // divide-by-zero issues.
2845  Real
2846  den = (-1. + zeta + eps),
2847  den2 = den*den,
2848  den3 = den2*den,
2849  den4 = den2*den2;
2850 
2851  // These terms are used in several of the derivatives
2852  Real
2853  numer_mp = xi*eta - zeta + zeta*zeta,
2854  numer_pm = xi*eta + zeta - zeta*zeta;
2855 
2856  switch (j)
2857  {
2858  case 0: // d^2()/dxi^2
2859  {
2860  switch(i)
2861  {
2862  case 0:
2863  case 1:
2864  return -p1*eta/den2;
2865  case 2:
2866  case 3:
2867  return p3*eta/den2;
2868  case 4:
2869  case 9:
2870  case 10:
2871  case 11:
2872  case 12:
2873  return 0.;
2874  case 5:
2875  return 2.*p1*eta/den2;
2876  case 6:
2877  case 8:
2878  return 4.*p1*p3/den2;
2879  case 7:
2880  return -2.*p3*eta/den2;
2881  case 13:
2882  return -8.*p1*p3/den2;
2883  default:
2884  libmesh_error_msg("Invalid i = " << i);
2885  }
2886  }
2887 
2888  case 1: // d^2()/dxideta
2889  {
2890  switch(i)
2891  {
2892  case 0:
2893  return 0.25*numer_mp/den2
2894  - 0.5*p1*xi/den2
2895  - 0.5*p4*eta/den2
2896  + p4*p1/den2;
2897 
2898  case 1:
2899  return 0.25*numer_pm/den2
2900  - 0.5*p1*xi/den2
2901  + 0.5*p2*eta/den2
2902  - p1*p2/den2;
2903 
2904  case 2:
2905  return 0.25*numer_mp/den2
2906  + 0.5*p3*xi/den2
2907  + 0.5*p2*eta/den2
2908  + p2*p3/den2;
2909 
2910  case 3:
2911  return 0.25*numer_pm/den2
2912  + 0.5*p3*xi/den2
2913  - 0.5*p4*eta/den2
2914  - p3*p4/den2;
2915 
2916  case 4:
2917  return 0.;
2918 
2919  case 5:
2920  return p4*eta/den2
2921  - 2.*p4*p1/den2
2922  - p2*eta/den2
2923  + 2.*p1*p2/den2;
2924 
2925  case 6:
2926  return -p3*xi/den2
2927  + p1*xi/den2
2928  - 2.*p2*p3/den2
2929  + 2.*p1*p2/den2;
2930 
2931  case 7:
2932  return p4*eta/den2
2933  + 2.*p3*p4/den2
2934  - p2*eta/den2
2935  - 2.*p2*p3/den2;
2936 
2937  case 8:
2938  return -p3*xi/den2
2939  + p1*xi/den2
2940  - 2.*p4*p1/den2
2941  + 2.*p3*p4/den2;
2942 
2943  case 9:
2944  case 11:
2945  return -zeta/den;
2946 
2947  case 10:
2948  case 12:
2949  return zeta/den;
2950 
2951  case 13:
2952  return 4.*p4*p1/den2
2953  - 4.*p3*p4/den2
2954  + 4.*p2*p3/den2
2955  - 4.*p1*p2/den2;
2956 
2957  default:
2958  libmesh_error_msg("Invalid i = " << i);
2959  }
2960  }
2961 
2962 
2963  case 2: // d^2()/deta^2
2964  {
2965  switch(i)
2966  {
2967  case 0:
2968  case 3:
2969  return -p4*xi/den2;
2970  case 1:
2971  case 2:
2972  return p2*xi/den2;
2973  case 4:
2974  case 9:
2975  case 10:
2976  case 11:
2977  case 12:
2978  return 0.;
2979  case 5:
2980  case 7:
2981  return 4.*p2*p4/den2;
2982  case 6:
2983  return -2.*p2*xi/den2;
2984  case 8:
2985  return 2.*p4*xi/den2;
2986  case 13:
2987  return -8.*p2*p4/den2;
2988  default:
2989  libmesh_error_msg("Invalid i = " << i);
2990  }
2991  }
2992 
2993 
2994  case 3: // d^2()/dxidzeta
2995  {
2996  switch(i)
2997  {
2998  case 0:
2999  return 0.25*numer_mp/den2
3000  - 0.5*p1*(2.*zeta - 1.)/den2
3001  + p1*numer_mp/den3
3002  - 0.5*p1*eta/den2
3003  - 0.5*p4*eta/den2
3004  - 2.*p4*p1*eta/den3;
3005 
3006  case 1:
3007  return 0.25*numer_pm/den2
3008  - 0.5*p1*(1 - 2.*zeta)/den2
3009  + p1*numer_pm/den3
3010  + 0.5*p2*eta/den2
3011  + 0.5*p1*eta/den2
3012  + 2.*p1*p2*eta/den3;
3013 
3014  case 2:
3015  return -0.25*numer_mp/den2
3016  + 0.5*p3*(2.*zeta - 1.)/den2
3017  - p3*numer_mp/den3
3018  - 0.5*p3*eta/den2
3019  - 0.5*p2*eta/den2
3020  - 2.*p2*p3*eta/den3;
3021 
3022  case 3:
3023  return -0.25*numer_pm/den2
3024  + 0.5*p3*(1 - 2.*zeta)/den2
3025  - p3*numer_pm/den3
3026  + 0.5*p4*eta/den2
3027  + 0.5*p3*eta/den2
3028  + 2.*p3*p4*eta/den3;
3029 
3030  case 4:
3031  return 0.;
3032 
3033  case 5:
3034  return p4*eta/den2
3035  + 4.*p4*p1*eta/den3
3036  - p2*eta/den2
3037  - 4.*p1*p2*eta/den3;
3038 
3039  case 6:
3040  return -p3*xi/den2
3041  - p1*xi/den2
3042  - 4.*p1*p3*xi/den3
3043  - 2.*p2*p3/den2
3044  - 2.*p1*p3/den2
3045  - 2.*p1*p2/den2
3046  - 8.*p1*p2*p3/den3;
3047 
3048  case 7:
3049  return -p4*eta/den2
3050  - 4.*p3*p4*eta/den3
3051  + p2*eta/den2
3052  + 4.*p2*p3*eta/den3;
3053 
3054  case 8:
3055  return -p3*xi/den2
3056  - p1*xi/den2
3057  - 4.*p1*p3*xi/den3
3058  + 2.*p4*p1/den2
3059  + 2.*p1*p3/den2
3060  + 2.*p3*p4/den2
3061  + 8.*p3*p4*p1/den3;
3062 
3063  case 9:
3064  return -zeta/den
3065  + 2.*p1/den
3066  - 2.*p1*zeta/den2;
3067 
3068  case 10:
3069  return zeta/den
3070  - 2.*p1/den
3071  + 2.*p1*zeta/den2;
3072 
3073  case 11:
3074  return zeta/den
3075  - 2.*p3/den
3076  + 2.*p3*zeta/den2;
3077 
3078  case 12:
3079  return -zeta/den
3080  + 2.*p3/den
3081  - 2.*p3*zeta/den2;
3082 
3083  case 13:
3084  return -4.*p4*p1/den2
3085  - 4.*p3*p4/den2
3086  - 16.*p3*p4*p1/den3
3087  + 4.*p2*p3/den2
3088  + 4.*p1*p2/den2
3089  + 16.*p1*p2*p3/den3;
3090 
3091  default:
3092  libmesh_error_msg("Invalid i = " << i);
3093  }
3094  }
3095 
3096  case 4: // d^2()/detadzeta
3097  {
3098  switch(i)
3099  {
3100  case 0:
3101  return 0.25*numer_mp/den2
3102  - 0.5*p4*(2.*zeta - 1.)/den2
3103  + p4*numer_mp/den3
3104  - 0.5*p1*xi/den2
3105  - 0.5*p4*xi/den2
3106  - 2.*p4*p1*xi/den3;
3107 
3108  case 1:
3109  return -0.25*numer_pm/den2
3110  + 0.5*p2*(1. - 2.*zeta)/den2
3111  - p2*numer_pm/den3
3112  + 0.5*p2*xi/den2
3113  + 0.5*p1*xi/den2
3114  + 2.*p1*p2*xi/den3;
3115 
3116  case 2:
3117  return -0.25*numer_mp/den2
3118  + 0.5*p2*(2.*zeta - 1.)/den2
3119  - p2*numer_mp/den3
3120  - 0.5*p3*xi/den2
3121  - 0.5*p2*xi/den2
3122  - 2.*p2*p3*xi/den3;
3123 
3124  case 3:
3125  return 0.25*numer_pm/den2
3126  - 0.5*p4*(1. - 2.*zeta)/den2
3127  + p4*numer_pm/den3
3128  + 0.5*p4*xi/den2
3129  + 0.5*p3*xi/den2
3130  + 2.*p3*p4*xi/den3;
3131 
3132  case 4:
3133  return 0.;
3134 
3135  case 5:
3136  return -p4*eta/den2
3137  - p2*eta/den2
3138  - 4.*p2*p4*eta/den3
3139  + 2.*p4*p1/den2
3140  + 2.*p2*p4/den2
3141  + 2.*p1*p2/den2
3142  + 8.*p2*p1*p4/den3;
3143 
3144  case 6:
3145  return p3*xi/den2
3146  + 4.*p2*p3*xi/den3
3147  - p1*xi/den2
3148  - 4.*p1*p2*xi/den3;
3149 
3150  case 7:
3151  return -p4*eta/den2
3152  - p2*eta/den2
3153  - 4.*p2*p4*eta/den3
3154  - 2.*p3*p4/den2
3155  - 2.*p2*p4/den2
3156  - 2.*p2*p3/den2
3157  - 8.*p2*p3*p4/den3;
3158 
3159  case 8:
3160  return p1*xi/den2
3161  + 4.*p4*p1*xi/den3
3162  - p3*xi/den2
3163  - 4.*p3*p4*xi/den3;
3164 
3165  case 9:
3166  return -zeta/den
3167  + 2.*p4/den
3168  - 2.*p4*zeta/den2;
3169 
3170  case 10:
3171  return -zeta/den
3172  + 2.*p2/den
3173  - 2.*p2*zeta/den2;
3174 
3175  case 11:
3176  return zeta/den
3177  - 2.*p2/den
3178  + 2.*p2*zeta/den2;
3179 
3180  case 12:
3181  return zeta/den
3182  - 2.*p4/den
3183  + 2.*p4*zeta/den2;
3184 
3185  case 13:
3186  return 4.*p3*p4/den2
3187  + 4.*p2*p3/den2
3188  + 16.*p2*p3*p4/den3
3189  - 4.*p4*p1/den2
3190  - 4.*p1*p2/den2
3191  - 16.*p2*p1*p4/den3;
3192 
3193  default:
3194  libmesh_error_msg("Invalid i = " << i);
3195  }
3196  }
3197 
3198  case 5: // d^2()/dzeta^2
3199  {
3200  switch(i)
3201  {
3202  case 0:
3203  return 0.5*numer_mp/den2
3204  - p1*(2.*zeta - 1.)/den2
3205  + 2.*p1*numer_mp/den3
3206  - p4*(2.*zeta - 1.)/den2
3207  + 2.*p4*numer_mp/den3
3208  + 2.*p4*p1/den2
3209  - 4.*p4*p1*(2.*zeta - 1.)/den3
3210  + 6.*p4*p1*numer_mp/den4;
3211 
3212  case 1:
3213  return -0.5*numer_pm/den2
3214  + p2*(1 - 2.*zeta)/den2
3215  - 2.*p2*numer_pm/den3
3216  + p1*(1 - 2.*zeta)/den2
3217  - 2.*p1*numer_pm/den3
3218  + 2.*p1*p2/den2
3219  + 4.*p1*p2*(1 - 2.*zeta)/den3
3220  - 6.*p1*p2*numer_pm/den4;
3221 
3222  case 2:
3223  return 0.5*numer_mp/den2
3224  - p3*(2.*zeta - 1.)/den2
3225  + 2.*p3*numer_mp/den3
3226  - p2*(2.*zeta - 1.)/den2
3227  + 2.*p2*numer_mp/den3
3228  + 2.*p2*p3/den2
3229  - 4.*p2*p3*(2.*zeta - 1.)/den3
3230  + 6.*p2*p3*numer_mp/den4;
3231 
3232  case 3:
3233  return -0.5*numer_pm/den2
3234  + p4*(1 - 2.*zeta)/den2
3235  - 2.*p4*numer_pm/den3
3236  + p3*(1 - 2.*zeta)/den2
3237  - 2.*p3*numer_pm/den3
3238  + 2.*p3*p4/den2
3239  + 4.*p3*p4*(1 - 2.*zeta)/den3
3240  - 6.*p3*p4*numer_pm/den4;
3241 
3242  case 4:
3243  return 4.;
3244 
3245  case 5:
3246  return -2.*p1*eta/den2
3247  - 2.*p4*eta/den2
3248  - 8.*p4*p1*eta/den3
3249  - 2.*p2*eta/den2
3250  - 8.*p2*p4*eta/den3
3251  - 8.*p1*p2*eta/den3
3252  - 24.*p2*p1*p4*eta/den4;
3253 
3254  case 6:
3255  return 2.*p3*xi/den2
3256  + 2.*p2*xi/den2
3257  + 8.*p2*p3*xi/den3
3258  + 2.*p1*xi/den2
3259  + 8.*p1*p3*xi/den3
3260  + 8.*p1*p2*xi/den3
3261  + 24.*p1*p2*p3*xi/den4;
3262 
3263  case 7:
3264  return 2.*p4*eta/den2
3265  + 2.*p3*eta/den2
3266  + 8.*p3*p4*eta/den3
3267  + 2.*p2*eta/den2
3268  + 8.*p2*p4*eta/den3
3269  + 8.*p2*p3*eta/den3
3270  + 24.*p2*p3*p4*eta/den4;
3271 
3272  case 8:
3273  return -2.*p1*xi/den2
3274  - 2.*p4*xi/den2
3275  - 8.*p4*p1*xi/den3
3276  - 2.*p3*xi/den2
3277  - 8.*p1*p3*xi/den3
3278  - 8.*p3*p4*xi/den3
3279  - 24.*p3*p4*p1*xi/den4;
3280 
3281  case 9:
3282  return -2.*zeta/den
3283  + 4.*p4/den
3284  - 4.*p4*zeta/den2
3285  + 4.*p1/den
3286  - 4.*p1*zeta/den2
3287  + 8.*p4*p1/den2
3288  - 8.*p1*p4*zeta/den3;
3289 
3290  case 10:
3291  return -2.*zeta/den
3292  + 4.*p1/den
3293  - 4.*p1*zeta/den2
3294  + 4.*p2/den
3295  - 4.*p2*zeta/den2
3296  + 8.*p1*p2/den2
3297  - 8.*p2*p1*zeta/den3;
3298 
3299  case 11:
3300  return -2.*zeta/den
3301  + 4.*p2/den
3302  - 4.*p2*zeta/den2
3303  + 4.*p3/den
3304  - 4.*p3*zeta/den2
3305  + 8.*p2*p3/den2
3306  - 8.*p3*p2*zeta/den3;
3307 
3308  case 12:
3309  return -2.*zeta/den
3310  + 4.*p3/den
3311  - 4.*p3*zeta/den2
3312  + 4.*p4/den
3313  - 4.*p4*zeta/den2
3314  + 8.*p3*p4/den2
3315  - 8.*p4*p3*zeta/den3;
3316 
3317  case 13:
3318  return 8.*p3*p4/den2
3319  + 8.*p2*p4/den2
3320  + 8.*p2*p3/den2
3321  + 32.*p2*p3*p4/den3
3322  + 8.*p4*p1/den2
3323  + 8.*p1*p3/den2
3324  + 32.*p3*p4*p1/den3
3325  + 8.*p1*p2/den2
3326  + 32.*p2*p1*p4/den3
3327  + 32.*p1*p2*p3/den3
3328  + 96.*p1*p2*p3*p4/den4;
3329 
3330  default:
3331  libmesh_error_msg("Invalid i = " << i);
3332  }
3333  }
3334 
3335  default:
3336  libmesh_error_msg("Invalid j = " << j);
3337  }
3338  }
3339 
3340  // G. Bedrosian, "Shape functions and integration formulas for
3341  // three-dimensional finite element analysis", Int. J. Numerical
3342  // Methods Engineering, vol 35, p. 95-108, 1992.
3343  case PYRAMID13:
3344  {
3345  libmesh_assert_less (i, 13);
3346 
3347  const Real xi = p(0);
3348  const Real eta = p(1);
3349  const Real zeta = p(2);
3350  const Real eps = 1.e-35;
3351 
3352  // Denominators are perturbed by epsilon to avoid
3353  // divide-by-zero issues.
3354  Real
3355  den = (-1. + zeta + eps),
3356  den2 = den*den,
3357  den3 = den2*den,
3358  xi2 = xi*xi,
3359  eta2 = eta*eta,
3360  zeta2 = zeta*zeta,
3361  zeta3 = zeta2*zeta;
3362 
3363  switch (j)
3364  {
3365  case 0: // d^2()/dxi^2
3366  {
3367  switch(i)
3368  {
3369  case 0:
3370  case 1:
3371  return 0.5*(-1. + zeta + eta)/den;
3372 
3373  case 2:
3374  case 3:
3375  return 0.5*(-1. + zeta - eta)/den;
3376 
3377  case 4:
3378  case 6:
3379  case 8:
3380  case 9:
3381  case 10:
3382  case 11:
3383  case 12:
3384  return 0.;
3385 
3386  case 5:
3387  return (1. - eta - zeta)/den;
3388 
3389  case 7:
3390  return (1. + eta - zeta)/den;
3391 
3392  default:
3393  libmesh_error_msg("Invalid i = " << i);
3394  }
3395  }
3396 
3397  case 1: // d^2()/dxideta
3398  {
3399  switch(i)
3400  {
3401  case 0:
3402  return 0.25*(-1. + 2.*zeta + 2.*xi + 2.*eta)/den;
3403 
3404  case 1:
3405  return -0.25*(-1. + 2.*zeta - 2.*xi + 2.*eta)/den;
3406 
3407  case 2:
3408  return -0.25*(1. - 2.*zeta + 2.*xi + 2.*eta)/den;
3409 
3410  case 3:
3411  return 0.25*(1. - 2.*zeta - 2.*xi + 2.*eta)/den;
3412 
3413  case 4:
3414  return 0.;
3415 
3416  case 5:
3417  return -xi/den;
3418 
3419  case 6:
3420  return eta/den;
3421 
3422  case 7:
3423  return xi/den;
3424 
3425  case 8:
3426  return -eta/den;
3427 
3428  case 9:
3429  return -zeta/den;
3430 
3431  case 10:
3432  return zeta/den;
3433 
3434  case 11:
3435  return -zeta/den;
3436 
3437  case 12:
3438  return zeta/den;
3439 
3440  default:
3441  libmesh_error_msg("Invalid i = " << i);
3442  }
3443  }
3444 
3445 
3446  case 2: // d^2()/deta^2
3447  {
3448  switch(i)
3449  {
3450  case 0:
3451  case 3:
3452  return 0.5*(-1. + zeta + xi)/den;
3453 
3454  case 1:
3455  case 2:
3456  return 0.5*(-1. + zeta - xi)/den;
3457 
3458  case 4:
3459  case 5:
3460  case 7:
3461  case 9:
3462  case 10:
3463  case 11:
3464  case 12:
3465  return 0.;
3466 
3467  case 6:
3468  return (1. + xi - zeta)/den;
3469 
3470  case 8:
3471  return (1. - xi - zeta)/den;
3472 
3473  default:
3474  libmesh_error_msg("Invalid i = " << i);
3475  }
3476  }
3477 
3478 
3479  case 3: // d^2()/dxidzeta
3480  {
3481  switch(i)
3482  {
3483  case 0:
3484  return -0.25*(-1. + 2.*zeta - zeta2 + eta + 2.*eta*xi + eta2)/den2;
3485 
3486  case 1:
3487  return 0.25*(-1. + 2.*zeta - zeta2 + eta - 2.*eta*xi + eta2)/den2;
3488 
3489  case 2:
3490  return 0.25*(-1. + 2.*zeta - zeta2 - eta + 2.*eta*xi + eta2)/den2;
3491 
3492  case 3:
3493  return -0.25*(-1. + 2.*zeta - zeta2 - eta - 2.*eta*xi + eta2)/den2;
3494 
3495  case 4:
3496  return 0.;
3497 
3498  case 5:
3499  return eta*xi/den2;
3500 
3501  case 6:
3502  return -0.5*(1. + zeta2 + eta2 - 2.*zeta)/den2;
3503 
3504  case 7:
3505  return -eta*xi/den2;
3506 
3507  case 8:
3508  return 0.5*(1. + zeta2 + eta2 - 2.*zeta)/den2;
3509 
3510  case 9:
3511  return (-1. - zeta2 + eta + 2.*zeta)/den2;
3512 
3513  case 10:
3514  return -(-1. - zeta2 + eta + 2.*zeta)/den2;
3515 
3516  case 11:
3517  return (1. + zeta2 + eta - 2.*zeta)/den2;
3518 
3519  case 12:
3520  return -(1. + zeta2 + eta - 2.*zeta)/den2;
3521 
3522  default:
3523  libmesh_error_msg("Invalid i = " << i);
3524  }
3525  }
3526 
3527  case 4: // d^2()/detadzeta
3528  {
3529  switch(i)
3530  {
3531  case 0:
3532  return -0.25*(-1. + 2.*zeta - zeta2 + xi + 2.*eta*xi + xi2)/den2;
3533 
3534  case 1:
3535  return 0.25*(1. - 2.*zeta + zeta2 + xi + 2.*eta*xi - xi2)/den2;
3536 
3537  case 2:
3538  return 0.25*(-1. + 2.*zeta - zeta2 - xi + 2.*eta*xi + xi2)/den2;
3539 
3540  case 3:
3541  return -0.25*(1. - 2.*zeta + zeta2 - xi + 2.*eta*xi - xi2)/den2;
3542 
3543  case 4:
3544  return 0.;
3545 
3546  case 5:
3547  return 0.5*(1. + xi2 + zeta2 - 2.*zeta)/den2;
3548 
3549  case 6:
3550  return -eta*xi/den2;
3551 
3552  case 7:
3553  return -0.5*(1. + xi2 + zeta2 - 2.*zeta)/den2;
3554 
3555  case 8:
3556  return eta*xi/den2;
3557 
3558  case 9:
3559  return (-1. - zeta2 + xi + 2.*zeta)/den2;
3560 
3561  case 10:
3562  return -(1. + zeta2 + xi - 2.*zeta)/den2;
3563 
3564  case 11:
3565  return (1. + zeta2 + xi - 2.*zeta)/den2;
3566 
3567  case 12:
3568  return -(-1. - zeta2 + xi + 2.*zeta)/den2;
3569 
3570  default:
3571  libmesh_error_msg("Invalid i = " << i);
3572  }
3573  }
3574 
3575  case 5: // d^2()/dzeta^2
3576  {
3577  switch(i)
3578  {
3579  case 0:
3580  return 0.5*(xi + eta + 1.)*eta*xi/den3;
3581 
3582  case 1:
3583  return -0.5*(eta - xi + 1.)*eta*xi/den3;
3584 
3585  case 2:
3586  return -0.5*(xi + eta - 1.)*eta*xi/den3;
3587 
3588  case 3:
3589  return 0.5*(eta - xi - 1.)*eta*xi/den3;
3590 
3591  case 4:
3592  return 4.;
3593 
3594  case 5:
3595  return -(1. - 3.*zeta + 3.*zeta2 - zeta3 + eta*xi2)/den3;
3596 
3597  case 6:
3598  return (-1. + 3.*zeta - 3.*zeta2 + zeta3 + eta2*xi)/den3;
3599 
3600  case 7:
3601  return (-1. + 3.*zeta - 3.*zeta2 + zeta3 + eta*xi2)/den3;
3602 
3603  case 8:
3604  return -(1. - 3.*zeta + 3.*zeta2 - zeta3 + eta2*xi)/den3;
3605 
3606  case 9:
3607  return -2.*(-1. + 3.*zeta - 3.*zeta2 + zeta3 + eta*xi)/den3;
3608 
3609  case 10:
3610  return 2.*(1. - 3.*zeta + 3.*zeta2 - zeta3 + eta*xi)/den3;
3611 
3612  case 11:
3613  return -2.*(-1. + 3.*zeta - 3.*zeta2 + zeta3 + eta*xi)/den3;
3614 
3615  case 12:
3616  return 2.*(1. - 3.*zeta + 3.*zeta2 - zeta3 + eta*xi)/den3;
3617 
3618  default:
3619  libmesh_error_msg("Invalid i = " << i);
3620  }
3621  }
3622 
3623  default:
3624  libmesh_error_msg("Invalid j = " << j);
3625  }
3626  }
3627 
3628  default:
3629  libmesh_error_msg("ERROR: Unsupported 3D element type!: " << type);
3630  }
3631  }
3632 
3633 
3634  // unsupported order
3635  default:
3636  libmesh_error_msg("ERROR: Unsupported 3D FE order!: " << order);
3637  }
3638 
3639 #endif
3640 
3641  libmesh_error_msg("We'll never get here!");
3642  return 0.;
3643 }
PetscErrorCode Vec x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<>
Real libMesh::FE< 2, CLOUGH >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 2195 of file fe_clough_shape_2D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::SECOND, libMesh::THIRD, libMesh::TRI6, and libMesh::Elem::type().

2200 {
2201  libmesh_assert(elem);
2202 
2203  clough_compute_coefs(elem);
2204 
2205  const ElemType type = elem->type();
2206 
2207  const Order totalorder = static_cast<Order>(order + elem->p_level());
2208 
2209  switch (totalorder)
2210  {
2211  // 2nd-order restricted Clough-Tocher element
2212  case SECOND:
2213  {
2214  switch (type)
2215  {
2216  // C1 functions on the Clough-Tocher triangle.
2217  case TRI6:
2218  {
2219  libmesh_assert_less (i, 9);
2220  // FIXME: it would be nice to calculate (and cache)
2221  // clough_raw_shape(j,p) only once per triangle, not 1-7
2222  // times
2223  switch (i)
2224  {
2225  // Note: these DoF numbers are "scrambled" because my
2226  // initial numbering conventions didn't match libMesh
2227  case 0:
2228  return clough_raw_shape_second_deriv(0, j, p)
2229  + d1d2n * clough_raw_shape_second_deriv(10, j, p)
2230  + d1d3n * clough_raw_shape_second_deriv(11, j, p);
2231  case 3:
2232  return clough_raw_shape_second_deriv(1, j, p)
2233  + d2d3n * clough_raw_shape_second_deriv(11, j, p)
2234  + d2d1n * clough_raw_shape_second_deriv(9, j, p);
2235  case 6:
2236  return clough_raw_shape_second_deriv(2, j, p)
2237  + d3d1n * clough_raw_shape_second_deriv(9, j, p)
2238  + d3d2n * clough_raw_shape_second_deriv(10, j, p);
2239  case 1:
2240  return d1xd1x * clough_raw_shape_second_deriv(3, j, p)
2241  + d1xd1y * clough_raw_shape_second_deriv(4, j, p)
2242  + d1xd2n * clough_raw_shape_second_deriv(10, j, p)
2243  + d1xd3n * clough_raw_shape_second_deriv(11, j, p)
2244  + 0.5 * N01x * d3nd3n * clough_raw_shape_second_deriv(11, j, p)
2245  + 0.5 * N02x * d2nd2n * clough_raw_shape_second_deriv(10, j, p);
2246  case 2:
2247  return d1yd1y * clough_raw_shape_second_deriv(4, j, p)
2248  + d1yd1x * clough_raw_shape_second_deriv(3, j, p)
2249  + d1yd2n * clough_raw_shape_second_deriv(10, j, p)
2250  + d1yd3n * clough_raw_shape_second_deriv(11, j, p)
2251  + 0.5 * N01y * d3nd3n * clough_raw_shape_second_deriv(11, j, p)
2252  + 0.5 * N02y * d2nd2n * clough_raw_shape_second_deriv(10, j, p);
2253  case 4:
2254  return d2xd2x * clough_raw_shape_second_deriv(5, j, p)
2255  + d2xd2y * clough_raw_shape_second_deriv(6, j, p)
2256  + d2xd3n * clough_raw_shape_second_deriv(11, j, p)
2257  + d2xd1n * clough_raw_shape_second_deriv(9, j, p)
2258  + 0.5 * N10x * d3nd3n * clough_raw_shape_second_deriv(11, j, p)
2259  + 0.5 * N12x * d1nd1n * clough_raw_shape_second_deriv(9, j, p);
2260  case 5:
2261  return d2yd2y * clough_raw_shape_second_deriv(6, j, p)
2262  + d2yd2x * clough_raw_shape_second_deriv(5, j, p)
2263  + d2yd3n * clough_raw_shape_second_deriv(11, j, p)
2264  + d2yd1n * clough_raw_shape_second_deriv(9, j, p)
2265  + 0.5 * N10y * d3nd3n * clough_raw_shape_second_deriv(11, j, p)
2266  + 0.5 * N12y * d1nd1n * clough_raw_shape_second_deriv(9, j, p);
2267  case 7:
2268  return d3xd3x * clough_raw_shape_second_deriv(7, j, p)
2269  + d3xd3y * clough_raw_shape_second_deriv(8, j, p)
2270  + d3xd1n * clough_raw_shape_second_deriv(9, j, p)
2271  + d3xd2n * clough_raw_shape_second_deriv(10, j, p)
2272  + 0.5 * N20x * d2nd2n * clough_raw_shape_second_deriv(10, j, p)
2273  + 0.5 * N21x * d1nd1n * clough_raw_shape_second_deriv(9, j, p);
2274  case 8:
2275  return d3yd3y * clough_raw_shape_second_deriv(8, j, p)
2276  + d3yd3x * clough_raw_shape_second_deriv(7, j, p)
2277  + d3yd1n * clough_raw_shape_second_deriv(9, j, p)
2278  + d3yd2n * clough_raw_shape_second_deriv(10, j, p)
2279  + 0.5 * N20y * d2nd2n * clough_raw_shape_second_deriv(10, j, p)
2280  + 0.5 * N21y * d1nd1n * clough_raw_shape_second_deriv(9, j, p);
2281  default:
2282  libmesh_error_msg("Invalid shape function index i = " << i);
2283  }
2284  }
2285  default:
2286  libmesh_error_msg("ERROR: Unsupported element type = " << type);
2287  }
2288  }
2289  // 3rd-order Clough-Tocher element
2290  case THIRD:
2291  {
2292  switch (type)
2293  {
2294  // C1 functions on the Clough-Tocher triangle.
2295  case TRI6:
2296  {
2297  libmesh_assert_less (i, 12);
2298 
2299  // FIXME: it would be nice to calculate (and cache)
2300  // clough_raw_shape(j,p) only once per triangle, not 1-7
2301  // times
2302  switch (i)
2303  {
2304  // Note: these DoF numbers are "scrambled" because my
2305  // initial numbering conventions didn't match libMesh
2306  case 0:
2307  return clough_raw_shape_second_deriv(0, j, p)
2308  + d1d2n * clough_raw_shape_second_deriv(10, j, p)
2309  + d1d3n * clough_raw_shape_second_deriv(11, j, p);
2310  case 3:
2311  return clough_raw_shape_second_deriv(1, j, p)
2312  + d2d3n * clough_raw_shape_second_deriv(11, j, p)
2313  + d2d1n * clough_raw_shape_second_deriv(9, j, p);
2314  case 6:
2315  return clough_raw_shape_second_deriv(2, j, p)
2316  + d3d1n * clough_raw_shape_second_deriv(9, j, p)
2317  + d3d2n * clough_raw_shape_second_deriv(10, j, p);
2318  case 1:
2319  return d1xd1x * clough_raw_shape_second_deriv(3, j, p)
2320  + d1xd1y * clough_raw_shape_second_deriv(4, j, p)
2321  + d1xd2n * clough_raw_shape_second_deriv(10, j, p)
2322  + d1xd3n * clough_raw_shape_second_deriv(11, j, p);
2323  case 2:
2324  return d1yd1y * clough_raw_shape_second_deriv(4, j, p)
2325  + d1yd1x * clough_raw_shape_second_deriv(3, j, p)
2326  + d1yd2n * clough_raw_shape_second_deriv(10, j, p)
2327  + d1yd3n * clough_raw_shape_second_deriv(11, j, p);
2328  case 4:
2329  return d2xd2x * clough_raw_shape_second_deriv(5, j, p)
2330  + d2xd2y * clough_raw_shape_second_deriv(6, j, p)
2331  + d2xd3n * clough_raw_shape_second_deriv(11, j, p)
2332  + d2xd1n * clough_raw_shape_second_deriv(9, j, p);
2333  case 5:
2334  return d2yd2y * clough_raw_shape_second_deriv(6, j, p)
2335  + d2yd2x * clough_raw_shape_second_deriv(5, j, p)
2336  + d2yd3n * clough_raw_shape_second_deriv(11, j, p)
2337  + d2yd1n * clough_raw_shape_second_deriv(9, j, p);
2338  case 7:
2339  return d3xd3x * clough_raw_shape_second_deriv(7, j, p)
2340  + d3xd3y * clough_raw_shape_second_deriv(8, j, p)
2341  + d3xd1n * clough_raw_shape_second_deriv(9, j, p)
2342  + d3xd2n * clough_raw_shape_second_deriv(10, j, p);
2343  case 8:
2344  return d3yd3y * clough_raw_shape_second_deriv(8, j, p)
2345  + d3yd3x * clough_raw_shape_second_deriv(7, j, p)
2346  + d3yd1n * clough_raw_shape_second_deriv(9, j, p)
2347  + d3yd2n * clough_raw_shape_second_deriv(10, j, p);
2348  case 10:
2349  return d1nd1n * clough_raw_shape_second_deriv(9, j, p);
2350  case 11:
2351  return d2nd2n * clough_raw_shape_second_deriv(10, j, p);
2352  case 9:
2353  return d3nd3n * clough_raw_shape_second_deriv(11, j, p);
2354 
2355  default:
2356  libmesh_error_msg("Invalid shape function index i = " << i);
2357  }
2358  }
2359  default:
2360  libmesh_error_msg("ERROR: Unsupported element type = " << type);
2361  }
2362  }
2363  // by default throw an error
2364  default:
2365  libmesh_error_msg("ERROR: Unsupported polynomial order = " << order);
2366  }
2367 
2368  libmesh_error_msg("We'll never get here!");
2369  return 0.;
2370 }
libmesh_assert(remote_elem)
unsigned int p_level() const
Definition: elem.h:2141
virtual ElemType type() const =0
template<>
Real libMesh::FE< 3, BERNSTEIN >::shape_second_deriv ( const ElemType  ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 2971 of file fe_bernstein_shape_3D.C.

References libMesh::err.

2976 {
2977  static bool warning_given = false;
2978 
2979  if (!warning_given)
2980  libMesh::err << "Second derivatives for Bernstein elements "
2981  << "are not yet implemented!"
2982  << std::endl;
2983 
2984  warning_given = true;
2985  return 0.;
2986 }
OStreamProxy err(std::cerr)
template<>
Real libMesh::FE< 3, BERNSTEIN >::shape_second_deriv ( const Elem ,
const Order  ,
const unsigned  int,
const unsigned  int,
const Point  
)

Definition at line 2991 of file fe_bernstein_shape_3D.C.

References libMesh::err.

2996 {
2997  static bool warning_given = false;
2998 
2999  if (!warning_given)
3000  libMesh::err << "Second derivatives for Bernstein elements "
3001  << "are not yet implemented!"
3002  << std::endl;
3003 
3004  warning_given = true;
3005  return 0.;
3006 }
OStreamProxy err(std::cerr)
template<>
Real libMesh::FE< 3, LAGRANGE >::shape_second_deriv ( const Elem elem,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const Point p 
)

Definition at line 3648 of file fe_lagrange_shape_3D.C.

References libMesh::libmesh_assert(), libMesh::Elem::p_level(), libMesh::FE< Dim, T >::shape_second_deriv(), and libMesh::Elem::type().

3653 {
3654  libmesh_assert(elem);
3655 
3656  // call the orientation-independent shape function derivatives
3657  return FE<3,LAGRANGE>::shape_second_deriv(elem->type(), static_cast<Order>(order + elem->p_level()), i, j, p);
3658 }
libmesh_assert(remote_elem)
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
template<>
bool libMesh::FE< 0, SCALAR >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 137 of file fe_scalar.C.

137 { return false; }
template<>
bool libMesh::FE< 1, SCALAR >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 138 of file fe_scalar.C.

138 { return false; }
template<>
bool libMesh::FE< 2, SCALAR >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 139 of file fe_scalar.C.

139 { return false; }
template<>
bool libMesh::FE< 3, SCALAR >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 140 of file fe_scalar.C.

140 { return false; }
template<>
bool libMesh::FE< 0, L2_HIERARCHIC >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 223 of file fe_l2_hierarchic.C.

223 { return true; }
template<>
bool libMesh::FE< 1, L2_HIERARCHIC >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 224 of file fe_l2_hierarchic.C.

224 { return true; }
template<>
bool libMesh::FE< 2, L2_HIERARCHIC >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 225 of file fe_l2_hierarchic.C.

225 { return true; }
template<>
bool libMesh::FE< 3, L2_HIERARCHIC >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 226 of file fe_l2_hierarchic.C.

226 { return true; }
template<>
bool libMesh::FE< 0, CLOUGH >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 328 of file fe_clough.C.

328 { return true; }
template<>
bool libMesh::FE< 1, CLOUGH >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 329 of file fe_clough.C.

329 { return true; }
template<>
bool libMesh::FE< 2, CLOUGH >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 330 of file fe_clough.C.

330 { return true; }
template<>
bool libMesh::FE< 3, CLOUGH >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 331 of file fe_clough.C.

331 { return true; }
template<>
bool libMesh::FE< 0, HERMITE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 369 of file fe_hermite.C.

369 { return true; }
template<>
bool libMesh::FE< 1, HERMITE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 370 of file fe_hermite.C.

370 { return true; }
template<>
bool libMesh::FE< 2, HERMITE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 371 of file fe_hermite.C.

371 { return true; }
template<>
bool libMesh::FE< 3, HERMITE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 372 of file fe_hermite.C.

372 { return true; }
template<>
bool libMesh::FE< 0, HIERARCHIC >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 396 of file fe_hierarchic.C.

396 { return true; }
template<>
bool libMesh::FE< 1, HIERARCHIC >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 397 of file fe_hierarchic.C.

397 { return true; }
template<>
bool libMesh::FE< 2, HIERARCHIC >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 398 of file fe_hierarchic.C.

398 { return true; }
template<>
bool libMesh::FE< 3, HIERARCHIC >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 399 of file fe_hierarchic.C.

399 { return true; }
template<unsigned int Dim, FEFamily T>
virtual bool libMesh::FE< Dim, T >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

template<>
bool libMesh::FE< 0, MONOMIAL >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 423 of file fe_monomial.C.

423 { return false; }
template<>
bool libMesh::FE< 1, MONOMIAL >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 424 of file fe_monomial.C.

424 { return false; }
template<>
bool libMesh::FE< 2, MONOMIAL >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 425 of file fe_monomial.C.

425 { return false; }
template<>
bool libMesh::FE< 3, MONOMIAL >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 426 of file fe_monomial.C.

426 { return false; }
template<>
bool libMesh::FE< 0, BERNSTEIN >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 460 of file fe_bernstein.C.

460 { return true; }
template<>
bool libMesh::FE< 1, BERNSTEIN >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 461 of file fe_bernstein.C.

461 { return true; }
template<>
bool libMesh::FE< 2, BERNSTEIN >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 462 of file fe_bernstein.C.

462 { return true; }
template<>
bool libMesh::FE< 3, BERNSTEIN >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 463 of file fe_bernstein.C.

463 { return true; }
template<>
bool libMesh::FE< 0, L2_LAGRANGE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 487 of file fe_l2_lagrange.C.

487 { return false; }
template<>
bool libMesh::FE< 1, L2_LAGRANGE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 488 of file fe_l2_lagrange.C.

488 { return false; }
template<>
bool libMesh::FE< 2, L2_LAGRANGE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 489 of file fe_l2_lagrange.C.

489 { return false; }
template<>
bool libMesh::FE< 3, L2_LAGRANGE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 490 of file fe_l2_lagrange.C.

490 { return false; }
template<>
bool libMesh::FE< 0, NEDELEC_ONE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 562 of file fe_nedelec_one.C.

562 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
bool libMesh::FE< 1, NEDELEC_ONE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 563 of file fe_nedelec_one.C.

563 { NEDELEC_LOW_D_ERROR_MESSAGE }
template<>
bool libMesh::FE< 2, NEDELEC_ONE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 564 of file fe_nedelec_one.C.

564 { return true; }
template<>
bool libMesh::FE< 3, NEDELEC_ONE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 565 of file fe_nedelec_one.C.

565 { return true; }
template<>
bool libMesh::FE< 0, LAGRANGE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 890 of file fe_lagrange.C.

890 { return false; }
template<>
bool libMesh::FE< 1, LAGRANGE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 891 of file fe_lagrange.C.

891 { return false; }
template<>
bool libMesh::FE< 2, LAGRANGE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 892 of file fe_lagrange.C.

892 { return false; }
template<>
bool libMesh::FE< 3, LAGRANGE >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 893 of file fe_lagrange.C.

893 { return false; }
template<>
bool libMesh::FE< 2, SUBDIVISION >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 934 of file fe_subdivision_2D.C.

934 { return true; }
template<>
bool libMesh::FE< 0, XYZ >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 938 of file fe_xyz.C.

938 { return true; }
template<>
bool libMesh::FE< 1, XYZ >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 939 of file fe_xyz.C.

939 { return true; }
template<>
bool libMesh::FE< 0, LAGRANGE_VEC >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 939 of file fe_lagrange_vec.C.

939 { return false; }
template<>
bool libMesh::FE< 1, LAGRANGE_VEC >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 940 of file fe_lagrange_vec.C.

940 { return false; }
template<>
bool libMesh::FE< 2, XYZ >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 940 of file fe_xyz.C.

940 { return true; }
template<>
bool libMesh::FE< 3, XYZ >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 941 of file fe_xyz.C.

941 { return true; }
template<>
bool libMesh::FE< 2, LAGRANGE_VEC >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 941 of file fe_lagrange_vec.C.

941 { return false; }
template<>
bool libMesh::FE< 3, LAGRANGE_VEC >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 942 of file fe_lagrange_vec.C.

942 { return false; }
template<>
bool libMesh::FE< 0, SZABAB >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 1309 of file fe_szabab.C.

1309 { return true; }
template<>
bool libMesh::FE< 1, SZABAB >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 1310 of file fe_szabab.C.

1310 { return true; }
template<>
bool libMesh::FE< 2, SZABAB >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 1311 of file fe_szabab.C.

1311 { return true; }
template<>
bool libMesh::FE< 3, SZABAB >::shapes_need_reinit ( ) const
virtual
Returns
true when the shape functions (for this FEFamily) depend on the particular element, and therefore needs to be re-initialized for each new element. false otherwise.

Implements libMesh::FEAbstract.

Definition at line 1312 of file fe_szabab.C.

1312 { return true; }
template<unsigned int Dim, FEFamily T>
void libMesh::FE< Dim, T >::side_map ( const Elem elem,
const Elem side,
const unsigned int  s,
const std::vector< Point > &  reference_side_points,
std::vector< Point > &  reference_points 
)
virtual

Computes the reference space quadrature points on the side of an element based on the side quadrature points.

Implements libMesh::FEAbstract.

Definition at line 353 of file fe_boundary.C.

References libmesh_nullptr, std::max(), libMesh::Elem::n_nodes(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_id(), libMesh::Elem::p_level(), side, libMesh::Elem::type(), and libMesh::zero.

358 {
359  // We're calculating mappings - we need at least first order info
360  this->calculate_phi = true;
361  this->determine_calculations();
362 
363  unsigned int side_p_level = elem->p_level();
364  if (elem->neighbor_ptr(s) != libmesh_nullptr)
365  side_p_level = std::max(side_p_level, elem->neighbor_ptr(s)->p_level());
366 
367  if (side->type() != last_side ||
368  side_p_level != this->_p_level ||
369  !this->shapes_on_quadrature)
370  {
371  // Set the element type
372  this->elem_type = elem->type();
373  this->_p_level = side_p_level;
374 
375  // Set the last_side
376  last_side = side->type();
377 
378  // Initialize the face shape functions
379  this->_fe_map->template init_face_shape_functions<Dim>(reference_side_points, side);
380  }
381 
382  const unsigned int n_points =
383  cast_int<unsigned int>(reference_side_points.size());
384  reference_points.resize(n_points);
385  for (unsigned int i = 0; i < n_points; i++)
386  reference_points[i].zero();
387 
388  std::vector<unsigned int> elem_nodes_map;
389  elem_nodes_map.resize(side->n_nodes());
390  for (unsigned int j = 0; j < side->n_nodes(); j++)
391  for (unsigned int i = 0; i < elem->n_nodes(); i++)
392  if (side->node_id(j) == elem->node_id(i))
393  elem_nodes_map[j] = i;
394  std::vector<Point> refspace_nodes;
395  this->get_refspace_nodes(elem->type(), refspace_nodes);
396 
397  const std::vector<std::vector<Real> > & psi_map = this->_fe_map->get_psi();
398 
399  for (unsigned int i=0; i<psi_map.size(); i++) // sum over the nodes
400  {
401  const Point & side_node = refspace_nodes[elem_nodes_map[i]];
402  for (unsigned int p=0; p<n_points; p++)
403  reference_points[p].add_scaled (side_node, psi_map[i][p]);
404  }
405 }
unsigned int _p_level
Definition: fe_abstract.h:571
unsigned short int side
Definition: xdr_io.C:49
const class libmesh_nullptr_t libmesh_nullptr
const Number zero
Definition: libmesh.h:179
long double max(long double a, double b)
static void get_refspace_nodes(const ElemType t, std::vector< Point > &nodes)
Definition: fe_abstract.C:259
UniquePtr< FEMap > _fe_map
Definition: fe_abstract.h:510
ElemType last_side
Definition: fe.h:476
template<>
void libMesh::FE< 2, SUBDIVISION >::side_map ( const Elem elem,
const Elem side,
const unsigned  s,
const std::vector< Point > &  reference_side_points,
std::vector< Point > &  reference_points 
)
virtual

Computes the reference space quadrature points on the side of an element based on the side quadrature points.

Implements libMesh::FEAbstract.

Definition at line 874 of file fe_subdivision_2D.C.

879 {
880  libmesh_not_implemented();
881 }

Friends And Related Function Documentation

template<unsigned int Dim, FEFamily T>
template<unsigned int friend_Dim, FEFamily friend_T_radial, InfMapType friend_T_map>
friend class InfFE
friend

make InfFE classes friends, so that these may access the private map, map_xyz methods

Definition at line 441 of file fe.h.

Member Data Documentation

ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited
bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 134 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info(), and libMesh::ReferenceCounter::print_info().

UniquePtr<FETransformationBase<FEOutputType< T >::type > > libMesh::FEGenericBase< FEOutputType< T >::type >::_fe_trans
protectedinherited

Object that handles computing shape function values, gradients, etc in the physical domain.

Definition at line 506 of file fe_base.h.

Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 128 of file reference_counter.h.

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects. Print the reference count information when the number returns to 0.

Definition at line 123 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().

unsigned int libMesh::FEAbstract::_p_level
protectedinherited

The p refinement level the current data structures are set up for.

Definition at line 571 of file fe_abstract.h.

Referenced by libMesh::FEAbstract::get_order(), and libMesh::FEAbstract::get_p_level().

template<unsigned int Dim, FEFamily T>
std::vector<Point> libMesh::FE< Dim, T >::cached_nodes
protected

An array of the node locations on the last element we computed on

Definition at line 471 of file fe.h.

bool libMesh::FEAbstract::calculate_curl_phi
mutableprotectedinherited

Should we calculate shape function curls?

Definition at line 542 of file fe_abstract.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_curl_phi().

bool libMesh::FEAbstract::calculate_div_phi
mutableprotectedinherited

Should we calculate shape function divergences?

Definition at line 547 of file fe_abstract.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_div_phi().

bool libMesh::FEAbstract::calculate_dphiref
mutableprotectedinherited

Should we calculate reference shape function gradients?

Definition at line 552 of file fe_abstract.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_curl_phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phideta2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidetadzeta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidx2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdy(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxi2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxideta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxidzeta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidy2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidydz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidz2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidzeta2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_div_phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphideta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidx(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidxi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidy(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidz(), and libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidzeta().

bool libMesh::FEAbstract::calculate_phi
mutableprotectedinherited

Should we calculate shape functions?

Definition at line 527 of file fe_abstract.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_phi().

bool libMesh::FEAbstract::calculations_started
mutableprotectedinherited

Have calculations with this object already been started? Then all get_* functions should already have been called.

Definition at line 522 of file fe_abstract.h.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::get_curl_phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phideta2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidetadzeta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidx2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdy(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxdz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxi2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxideta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidxidzeta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidy2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidydz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidz2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_d2phidzeta2(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_div_phi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphideta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidx(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidxi(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidy(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidz(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_dphidzeta(), libMesh::FEGenericBase< FEOutputType< T >::type >::get_phi(), and libMesh::FESubdivision::init_shape_functions().

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::curl_phi
protectedinherited

Shape function curl values. Only defined for vector types.

Definition at line 521 of file fe_base.h.

std::vector<std::vector<OutputTensor> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phi
protectedinherited

Shape function second derivative values.

Definition at line 564 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phideta2
protectedinherited

Shape function second derivatives in the eta direction.

Definition at line 584 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidetadzeta
protectedinherited

Shape function second derivatives in the eta-zeta direction.

Definition at line 589 of file fe_base.h.

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidx2
protectedinherited

Shape function second derivatives in the x direction.

Definition at line 599 of file fe_base.h.

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidxdy
protectedinherited

Shape function second derivatives in the x-y direction.

Definition at line 604 of file fe_base.h.

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidxdz
protectedinherited

Shape function second derivatives in the x-z direction.

Definition at line 609 of file fe_base.h.

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidxi2
protectedinherited

Shape function second derivatives in the xi direction.

Definition at line 569 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidxideta
protectedinherited

Shape function second derivatives in the xi-eta direction.

Definition at line 574 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidxidzeta
protectedinherited

Shape function second derivatives in the xi-zeta direction.

Definition at line 579 of file fe_base.h.

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidy2
protectedinherited

Shape function second derivatives in the y direction.

Definition at line 614 of file fe_base.h.

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidydz
protectedinherited

Shape function second derivatives in the y-z direction.

Definition at line 619 of file fe_base.h.

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidz2
protectedinherited

Shape function second derivatives in the z direction.

Definition at line 624 of file fe_base.h.

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::d2phidzeta2
protectedinherited

Shape function second derivatives in the zeta direction.

Definition at line 594 of file fe_base.h.

const unsigned int libMesh::FEAbstract::dim
protectedinherited

The dimensionality of the object

Definition at line 516 of file fe_abstract.h.

std::vector<std::vector<OutputDivergence> > libMesh::FEGenericBase< FEOutputType< T >::type >::div_phi
protectedinherited

Shape function divergence values. Only defined for vector types.

Definition at line 526 of file fe_base.h.

std::vector<OutputGradient> libMesh::FEGenericBase< FEOutputType< T >::type >::dphase
protectedinherited

Used for certain infinite element families: the first derivatives of the phase term in global coordinates, over all quadrature points.

Definition at line 642 of file fe_base.h.

std::vector<std::vector<OutputGradient> > libMesh::FEGenericBase< FEOutputType< T >::type >::dphi
protectedinherited

Shape function derivative values.

Definition at line 516 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::dphideta
protectedinherited

Shape function derivatives in the eta direction.

Definition at line 536 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::dphidx
protectedinherited

Shape function derivatives in the x direction.

Definition at line 546 of file fe_base.h.

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::dphidxi
protectedinherited

Shape function derivatives in the xi direction.

Definition at line 531 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::dphidy
protectedinherited

Shape function derivatives in the y direction.

Definition at line 551 of file fe_base.h.

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::dphidz
protectedinherited

Shape function derivatives in the z direction.

Definition at line 556 of file fe_base.h.

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::dphidzeta
protectedinherited

Shape function derivatives in the zeta direction.

Definition at line 541 of file fe_base.h.

std::vector<RealGradient> libMesh::FEGenericBase< FEOutputType< T >::type >::dweight
protectedinherited

Used for certain infinite element families: the global derivative of the additional radial weight $ 1/{r^2} $, over all quadrature points.

Definition at line 649 of file fe_base.h.

ElemType libMesh::FEAbstract::elem_type
protectedinherited

The element type the current data structures are set up for.

Definition at line 565 of file fe_abstract.h.

Referenced by libMesh::FESubdivision::attach_quadrature_rule(), and libMesh::FEAbstract::get_type().

template<unsigned int Dim, FEFamily T>
unsigned int libMesh::FE< Dim, T >::last_edge
protected

Definition at line 478 of file fe.h.

template<unsigned int Dim, FEFamily T>
ElemType libMesh::FE< Dim, T >::last_side
protected

The last side and last edge we did a reinit on

Definition at line 476 of file fe.h.

std::vector<std::vector<OutputShape> > libMesh::FEGenericBase< FEOutputType< T >::type >::phi
protectedinherited

Shape function values.

Definition at line 511 of file fe_base.h.

Referenced by libMesh::FESubdivision::init_shape_functions().

QBase* libMesh::FEAbstract::qrule
protectedinherited

A pointer to the quadrature rule employed

Definition at line 576 of file fe_abstract.h.

Referenced by libMesh::FESubdivision::attach_quadrature_rule().

bool libMesh::FEAbstract::shapes_on_quadrature
protectedinherited

A flag indicating if current data structures correspond to quadrature rule points

Definition at line 582 of file fe_abstract.h.

std::vector<Real> libMesh::FEGenericBase< FEOutputType< T >::type >::weight
protectedinherited

Used for certain infinite element families: the additional radial weight $ 1/{r^2} $ in local coordinates, over all quadrature points.

Definition at line 656 of file fe_base.h.


The documentation for this class was generated from the following files: